2010-09-14 10:47:45 +00:00
|
|
|
.POSIX:
|
|
|
|
|
2011-04-04 11:52:16 +00:00
|
|
|
.SUFFIXES: .cc .c .m .o
|
2011-02-19 12:49:26 +00:00
|
|
|
|
2011-04-04 11:52:16 +00:00
|
|
|
MAJOR_VERSION = 1
|
2011-04-14 09:51:49 +00:00
|
|
|
MINOR_VERSION = 4
|
2011-04-04 11:52:16 +00:00
|
|
|
SUBMINOR_VERSION = 0
|
|
|
|
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(SUBMINOR_VERSION)
|
2010-09-14 10:47:45 +00:00
|
|
|
|
2011-04-04 11:52:16 +00:00
|
|
|
CFLAGS += -std=gnu99 -fPIC
|
2011-04-04 13:24:53 +00:00
|
|
|
CXXFLAGS += -fPIC
|
2010-10-26 15:44:43 +00:00
|
|
|
CPPFLAGS += -DTYPE_DEPENDENT_DISPATCH -DGNUSTEP
|
2010-10-05 16:09:24 +00:00
|
|
|
CPPFLAGS += -D__OBJC_RUNTIME_INTERNAL__=1 -D_XOPEN_SOURCE=500
|
2010-09-14 10:47:45 +00:00
|
|
|
|
2011-04-06 18:17:18 +00:00
|
|
|
# Suppress warnings about incorrect selectors
|
|
|
|
CPPFLAGS += -DNO_SELECTOR_MISMATCH_WARNINGS
|
|
|
|
|
2010-10-07 14:18:03 +00:00
|
|
|
PREFIX?= /usr/local
|
|
|
|
LIB_DIR= ${PREFIX}/lib
|
|
|
|
HEADER_DIR= ${PREFIX}/include
|
2010-09-14 10:47:45 +00:00
|
|
|
|
2011-04-05 17:21:30 +00:00
|
|
|
OBJCXX_OBJECTS = \
|
|
|
|
objcxx_eh.o
|
|
|
|
|
2010-09-14 10:47:45 +00:00
|
|
|
OBJECTS = \
|
|
|
|
NSBlocks.o\
|
|
|
|
Protocol2.o\
|
|
|
|
abi_version.o\
|
2011-03-25 20:01:43 +00:00
|
|
|
alias_table.o\
|
2011-04-17 18:04:58 +00:00
|
|
|
associate.o\
|
2010-09-14 10:47:45 +00:00
|
|
|
blocks_runtime.o\
|
|
|
|
caps.o\
|
|
|
|
category_loader.o\
|
|
|
|
class_table.o\
|
|
|
|
dtable.o\
|
|
|
|
eh_personality.o\
|
|
|
|
encoding2.o\
|
|
|
|
hash_table.o\
|
|
|
|
hooks.o\
|
|
|
|
ivar.o\
|
|
|
|
legacy_malloc.o\
|
|
|
|
loader.o\
|
|
|
|
mutation.o\
|
|
|
|
properties.o\
|
|
|
|
protocol.o\
|
|
|
|
runtime.o\
|
|
|
|
sarray2.o\
|
|
|
|
selector_table.o\
|
|
|
|
sendmsg2.o\
|
|
|
|
statics_loader.o\
|
2011-04-04 12:01:58 +00:00
|
|
|
toydispatch.o
|
2010-09-14 10:47:45 +00:00
|
|
|
|
2011-04-05 18:02:47 +00:00
|
|
|
all: libobjc.a libobjcxx.so.$(VERSION)
|
2011-04-05 17:21:30 +00:00
|
|
|
|
2011-04-05 18:02:47 +00:00
|
|
|
libobjcxx.so.$(VERSION): libobjc.so.$(VERSION) $(OBJCXX_OBJECTS)
|
|
|
|
@echo Linking shared Objective-C++ runtime library...
|
|
|
|
@$(CXX) -Wl,-shared -o $@ $(OBJCXX_OBJECTS) -lobjc
|
2010-09-14 10:47:45 +00:00
|
|
|
|
|
|
|
libobjc.so.$(VERSION): $(OBJECTS)
|
2011-04-05 18:02:47 +00:00
|
|
|
@echo Linking shared Objective-C runtime library...
|
2011-04-05 17:21:30 +00:00
|
|
|
@ld -shared -o $@ $(OBJECTS)
|
2010-10-05 21:49:40 +00:00
|
|
|
|
|
|
|
libobjc.a: $(OBJECTS)
|
2011-04-05 18:02:47 +00:00
|
|
|
@echo Linking static Objective-C runtime library...
|
|
|
|
@ld -r -s -o $@ $(OBJECTS)
|
2010-10-05 21:49:40 +00:00
|
|
|
|
2011-04-04 11:52:16 +00:00
|
|
|
.cc.o:
|
2011-04-05 18:02:47 +00:00
|
|
|
@echo Compiling `basename $<`...
|
|
|
|
@$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
|
2011-04-04 11:52:16 +00:00
|
|
|
|
2010-09-14 10:47:45 +00:00
|
|
|
.c.o:
|
2011-04-05 18:02:47 +00:00
|
|
|
@echo Compiling `basename $<`...
|
|
|
|
@$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
|
2010-09-14 10:47:45 +00:00
|
|
|
|
|
|
|
.m.o:
|
2011-04-05 18:02:47 +00:00
|
|
|
@echo Compiling `basename $<`...
|
|
|
|
@$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
|
2010-09-14 10:47:45 +00:00
|
|
|
|
|
|
|
install: all
|
2011-04-05 18:02:47 +00:00
|
|
|
@echo Installing libraries...
|
|
|
|
@install -d $(LIB_DIR)
|
|
|
|
@install -m 444 libobjc.so.$(VERSION) $(LIB_DIR)
|
|
|
|
@install -m 444 libobjcxx.so.$(VERSION) $(LIB_DIR)
|
|
|
|
@install -m 444 libobjc.a $(LIB_DIR)
|
|
|
|
@echo Creating symbolic links...
|
|
|
|
@ln -sf $(LIB_DIR)/libobjc.so.$(VERSION) $(LIB_DIR)/libobjc.so
|
|
|
|
@ln -sf $(LIB_DIR)/libobjc.so.$(VERSION) $(LIB_DIR)/libobjc.so.$(MAJOR_VERSION)
|
|
|
|
@ln -sf $(LIB_DIR)/libobjc.so.$(VERSION) $(LIB_DIR)/libobjc.so.$(MAJOR_VERSION).$(MINOR_VERSION)
|
|
|
|
@ln -sf $(LIB_DIR)/libobjcxx.so.$(VERSION) $(LIB_DIR)/libobjcxx.so
|
|
|
|
@ln -sf $(LIB_DIR)/libobjcxx.so.$(VERSION) $(LIB_DIR)/libobjcxx.so.$(MAJOR_VERSION)
|
|
|
|
@ln -sf $(LIB_DIR)/libobjcxx.so.$(VERSION) $(LIB_DIR)/libobjcxx.so.$(MAJOR_VERSION).$(MINOR_VERSION)
|
|
|
|
@echo Installing headers...
|
|
|
|
@install -d $(HEADER_DIR)/objc
|
|
|
|
@install -m 444 objc/*.h $(HEADER_DIR)/objc
|
2010-09-14 10:47:45 +00:00
|
|
|
|
|
|
|
clean:
|
2011-04-05 18:02:47 +00:00
|
|
|
@echo Cleaning...
|
|
|
|
@rm -f $(OBJECTS)
|
|
|
|
@rm -f $(OBJCXX_OBJECTS)
|
|
|
|
@rm -f libobjc.so.$(VERSION)
|
|
|
|
@rm -f libobjcxx.so.$(VERSION)
|
|
|
|
@rm -f libobjc.a
|