2010-09-22 10:37:10 +00:00
|
|
|
|
|
|
|
PACKAGE_NAME = gnustep-objc2
|
2011-04-14 09:51:49 +00:00
|
|
|
VERSION=1.4.0
|
2010-09-22 10:37:10 +00:00
|
|
|
SVN_MODULE_NAME = libobjc2
|
|
|
|
SVN_BASE_URL = svn+ssh://svn.gna.org/svn/gnustep/libs
|
|
|
|
SVN_TAG_NAME=objc2
|
|
|
|
|
2009-09-08 16:18:59 +00:00
|
|
|
include $(GNUSTEP_MAKEFILES)/common.make
|
|
|
|
|
2011-06-23 10:30:56 +00:00
|
|
|
LIBOBJC = libobjc
|
|
|
|
LIBOBJCLIBNAME = objc
|
|
|
|
LIBOBJCXX = libobjcxx
|
2010-09-22 10:37:10 +00:00
|
|
|
|
2011-06-23 10:30:56 +00:00
|
|
|
LIBRARY_NAME = ${LIBOBJC} ${LIBOBJCXX}
|
2009-09-08 16:18:59 +00:00
|
|
|
|
2011-06-23 10:30:56 +00:00
|
|
|
${LIBOBJC}_VERSION = 4
|
|
|
|
|
|
|
|
${LIBOBJC}_OBJC_FILES = \
|
2009-11-17 21:13:41 +00:00
|
|
|
NSBlocks.m\
|
2010-06-06 21:11:25 +00:00
|
|
|
Protocol2.m\
|
2011-06-28 16:29:42 +00:00
|
|
|
arc.m\
|
2011-04-15 11:20:37 +00:00
|
|
|
associate.m\
|
2009-11-17 21:13:41 +00:00
|
|
|
blocks_runtime.m\
|
|
|
|
mutation.m\
|
2011-04-17 18:04:58 +00:00
|
|
|
properties.m
|
2009-09-08 16:18:59 +00:00
|
|
|
|
|
|
|
|
2011-06-23 10:30:56 +00:00
|
|
|
${LIBOBJC}_C_FILES = \
|
2010-06-02 13:18:24 +00:00
|
|
|
abi_version.c\
|
2011-03-25 20:01:43 +00:00
|
|
|
alias_table.c\
|
2010-09-08 14:02:03 +00:00
|
|
|
caps.c\
|
2010-06-02 22:25:12 +00:00
|
|
|
category_loader.c\
|
2010-01-07 18:22:13 +00:00
|
|
|
class_table.c\
|
2010-06-03 15:17:12 +00:00
|
|
|
dtable.c\
|
2010-06-30 12:02:53 +00:00
|
|
|
eh_personality.c\
|
2010-06-04 23:40:07 +00:00
|
|
|
encoding2.c\
|
2011-05-22 23:02:04 +00:00
|
|
|
gc_none.c\
|
2010-01-25 22:56:54 +00:00
|
|
|
hash_table.c\
|
2010-06-01 12:59:57 +00:00
|
|
|
hooks.c\
|
2010-05-13 23:27:17 +00:00
|
|
|
ivar.c\
|
2010-06-02 22:25:12 +00:00
|
|
|
loader.c\
|
2009-09-08 16:18:59 +00:00
|
|
|
protocol.c\
|
|
|
|
runtime.c\
|
2010-05-13 22:29:56 +00:00
|
|
|
sarray2.c\
|
|
|
|
selector_table.c\
|
2010-06-03 15:17:12 +00:00
|
|
|
sendmsg2.c\
|
2010-10-26 15:44:43 +00:00
|
|
|
statics_loader.c\
|
|
|
|
toydispatch.c
|
2010-06-01 12:59:57 +00:00
|
|
|
|
2011-06-23 10:30:56 +00:00
|
|
|
${LIBOBJCXX}_CC_FILES = objcxx_eh.cc
|
|
|
|
${LIBOBJCXX}_LDFLAGS = -L./obj/$(GNUSTEP_TARGET_LDIR)/ -lstdc++ -l${LIBOBJCLIBNAME}
|
2011-03-20 20:38:12 +00:00
|
|
|
|
2011-04-22 12:02:56 +00:00
|
|
|
ifeq ($(disable_legacy), yes)
|
2011-06-23 10:30:56 +00:00
|
|
|
${LIBOBJC}_CPPFLAGS += -DNO_LEGACY
|
2011-04-22 12:02:56 +00:00
|
|
|
else
|
2011-06-23 10:30:56 +00:00
|
|
|
${LIBOBJC}_C_FILES += legacy_malloc.c
|
2010-06-29 22:00:43 +00:00
|
|
|
endif
|
|
|
|
|
2011-06-23 10:30:56 +00:00
|
|
|
${LIBOBJC}_HEADER_FILES_DIR = objc
|
|
|
|
${LIBOBJC}_HEADER_FILES_INSTALL_DIR = objc
|
2010-05-26 19:41:03 +00:00
|
|
|
ifneq ($(install_headers), no)
|
2011-06-23 10:30:56 +00:00
|
|
|
${LIBOBJC}_HEADER_FILES = \
|
2009-09-10 22:09:03 +00:00
|
|
|
Availability.h\
|
2010-09-09 11:41:50 +00:00
|
|
|
Object.h\
|
2010-09-09 12:00:19 +00:00
|
|
|
Protocol.h\
|
2009-09-10 22:09:03 +00:00
|
|
|
blocks_runtime.h\
|
2010-09-08 14:02:03 +00:00
|
|
|
capabilities.h\
|
2010-09-09 11:41:50 +00:00
|
|
|
encoding.h\
|
2010-06-30 12:02:53 +00:00
|
|
|
hooks.h\
|
2009-09-10 22:09:03 +00:00
|
|
|
runtime.h\
|
2011-03-22 20:53:16 +00:00
|
|
|
runtime-deprecated.h\
|
2010-09-06 18:27:07 +00:00
|
|
|
slot.h\
|
|
|
|
objc.h\
|
2010-10-26 15:44:43 +00:00
|
|
|
objc-api.h\
|
2011-06-29 13:12:02 +00:00
|
|
|
objc-arc.h\
|
2011-05-23 11:11:51 +00:00
|
|
|
objc-auto.h\
|
2010-10-26 15:44:43 +00:00
|
|
|
toydispatch.h
|
2010-05-21 13:49:19 +00:00
|
|
|
endif
|
2009-09-08 16:18:59 +00:00
|
|
|
|
2011-04-06 18:17:18 +00:00
|
|
|
# Disable type dependent dispatch if tdd=no is specified
|
2010-09-14 16:02:29 +00:00
|
|
|
ifneq ($(tdd), no)
|
2011-06-23 10:30:56 +00:00
|
|
|
${LIBOBJC}_CPPFLAGS += -DTYPE_DEPENDENT_DISPATCH
|
2010-08-31 22:03:53 +00:00
|
|
|
endif
|
|
|
|
|
2011-04-19 10:55:59 +00:00
|
|
|
ifeq ($(low_memory), yes)
|
2011-06-23 10:30:56 +00:00
|
|
|
${LIBOBJC}_CPPFLAGS += -D__OBJC_LOW_MEMORY__
|
2011-04-19 10:55:59 +00:00
|
|
|
endif
|
|
|
|
|
2011-05-26 14:25:15 +00:00
|
|
|
ifneq ($(boehm_gc), no)
|
2011-06-23 10:30:56 +00:00
|
|
|
${LIBOBJC}_C_FILES += gc_boehm.c
|
2011-05-27 18:11:53 +00:00
|
|
|
ifneq ($(findstring linux, $(GNUSTEP_TARGET_OS)), linux)
|
2011-06-23 10:30:56 +00:00
|
|
|
${LIBOBJC}_LIBRARIES_DEPEND_UPON += -lgc-threaded -lexecinfo
|
2011-05-27 18:11:53 +00:00
|
|
|
else
|
2011-06-23 10:30:56 +00:00
|
|
|
${LIBOBJC}_LIBRARIES_DEPEND_UPON += -lgc
|
2011-05-27 18:11:53 +00:00
|
|
|
endif
|
2011-06-23 10:30:56 +00:00
|
|
|
#${LIBOBJC}_OBJCFLAGS += -fobjc-gc
|
|
|
|
${LIBOBJC}_CPPFLAGS += -DENABLE_GC
|
2011-05-22 23:02:04 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-04-04 22:21:13 +00:00
|
|
|
ifeq ($(findstring openbsd, $(GNUSTEP_HOST_OS)), openbsd)
|
2011-06-23 10:30:56 +00:00
|
|
|
${LIBOBJC}_LIBRARIES_DEPEND_UPON += -pthread
|
2011-04-04 22:21:13 +00:00
|
|
|
else
|
2011-06-23 10:30:56 +00:00
|
|
|
${LIBOBJC}_LIBRARIES_DEPEND_UPON += -lpthread
|
2011-04-04 22:21:13 +00:00
|
|
|
endif
|
2009-12-30 16:01:38 +00:00
|
|
|
|
2011-04-06 18:17:18 +00:00
|
|
|
# If we're doing a release build, don't tell people that the code that they're
|
|
|
|
# using is rubbish - they complain.
|
2011-04-14 09:51:49 +00:00
|
|
|
#CPPFLAGS += -DNO_SELECTOR_MISMATCH_WARNINGS
|
2011-04-06 18:17:18 +00:00
|
|
|
|
|
|
|
|
2009-09-08 16:18:59 +00:00
|
|
|
# Deprecated functions are only deprecated for external use, not for us because
|
|
|
|
# we are special, precious, little flowers.
|
2011-06-23 10:30:56 +00:00
|
|
|
${LIBOBJC}_CPPFLAGS += -D__OBJC_RUNTIME_INTERNAL__=1 -D_XOPEN_SOURCE=500
|
2009-09-08 16:18:59 +00:00
|
|
|
# Note to Riccardo. Please do not 'fix' C99isms in this. The new ABI is only
|
|
|
|
# useful on compilers that support C99 (currently only clang), so there is no
|
|
|
|
# benefit from supporting platforms with no C99 compiler.
|
2011-06-23 10:30:56 +00:00
|
|
|
${LIBOBJC}_CFLAGS += -std=gnu99 -g -fexceptions #-fvisibility=hidden
|
|
|
|
${LIBOBJC}_CCFLAGS += -std=c++98 -g -fexceptions #-fvisibility=hidden
|
|
|
|
${LIBOBJC}_CFLAGS += -Wno-unused-function
|
2011-03-20 20:38:12 +00:00
|
|
|
|
2011-01-10 15:08:52 +00:00
|
|
|
# Uncomment this when debugging - it makes everything slow, but means that the
|
|
|
|
# debugger actually works...
|
2011-05-28 13:07:11 +00:00
|
|
|
ifeq ($(debug), yes)
|
2011-06-23 10:30:56 +00:00
|
|
|
${LIBOBJC}_CFLAGS += -fno-inline
|
2011-07-04 14:44:04 +00:00
|
|
|
${LIBOBJC}_OBJCFLAGS += -fno-inline
|
2011-06-23 10:30:56 +00:00
|
|
|
${LIBOBJC}_CPPFLAGS += -DGC_DEBUG
|
2011-07-04 14:44:04 +00:00
|
|
|
else
|
|
|
|
${LIBOBJC}_CFLAGS += -O3
|
2011-05-28 13:07:11 +00:00
|
|
|
endif
|
2011-06-23 10:30:56 +00:00
|
|
|
${LIBOBJC}_OBJCFLAGS += $(${LIBOBJC}_CFLAGS) $(${LIBOBJC}_CFLAGS)
|
2009-09-08 16:18:59 +00:00
|
|
|
|
|
|
|
ifneq ($(findstring gcc, $(CC)),)
|
2010-10-01 13:11:48 +00:00
|
|
|
# Hack to get the __sync_* GCC builtins to work with GCC
|
|
|
|
ifeq ($(GNUSTEP_TARGET_CPU), ix86)
|
2011-06-23 10:30:56 +00:00
|
|
|
${LIBOBJC}_CFLAGS += -march=i586
|
2010-10-01 13:11:48 +00:00
|
|
|
endif
|
2009-09-08 16:18:59 +00:00
|
|
|
endif
|
|
|
|
|
2010-09-29 02:07:51 +00:00
|
|
|
ifeq ($(GNUSTEP_TARGET_OS), mingw32)
|
2010-09-29 04:17:50 +00:00
|
|
|
# Hack to get mingw to provide declaration for strdup (since it is non-standard)
|
2011-06-23 10:30:56 +00:00
|
|
|
${LIBOBJC}_CPPFLAGS += -U__STRICT_ANSI__
|
2010-09-29 02:07:51 +00:00
|
|
|
endif
|
|
|
|
|
2010-01-25 13:07:16 +00:00
|
|
|
include $(GNUSTEP_MAKEFILES)/aggregate.make
|
2010-02-07 05:45:55 +00:00
|
|
|
include $(GNUSTEP_MAKEFILES)/library.make
|
2011-04-22 11:38:16 +00:00
|
|
|
|
2011-05-04 12:53:04 +00:00
|
|
|
build-opts:
|
2011-04-22 11:45:44 +00:00
|
|
|
@echo Building LLVM optimisation passes...
|
|
|
|
@sh build_opts.sh $(MAKE) all
|
2011-04-22 11:38:16 +00:00
|
|
|
|
2011-05-04 12:53:04 +00:00
|
|
|
install-opts: build_opts
|
2011-04-22 11:45:44 +00:00
|
|
|
@echo Installing LLVM optimisation passes...
|
|
|
|
@sh build_opts.sh $(MAKE) install
|
2011-04-22 11:38:16 +00:00
|
|
|
|
2011-05-04 12:53:04 +00:00
|
|
|
clean-opts:
|
2011-04-22 11:45:44 +00:00
|
|
|
@echo Cleaning LLVM optimisation passes...
|
|
|
|
@sh build_opts.sh $(MAKE) clean
|