diff options
author | Stefan Gartner <stefang@aon.at> | 2009-12-21 13:38:04 +0300 |
---|---|---|
committer | Stefan Gartner <stefang@aon.at> | 2009-12-21 13:38:04 +0300 |
commit | 5e6e3453a581f7f2bafae1ce4ebeba113a523c86 (patch) | |
tree | e63901f340c6e2e0c8f3f82fa128fd5127ef6c27 /source/nan_compile.mk | |
parent | f7f06d96f3c13623448d899e1fe2577ed6cbf996 (diff) |
OS X: added support for building with Cocoa to Makefiles
to build with Cocoa support, set WITH_COCOA to true in user-def.mk
Diffstat (limited to 'source/nan_compile.mk')
-rw-r--r-- | source/nan_compile.mk | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/source/nan_compile.mk b/source/nan_compile.mk index 258d06c07b9..9036d0a0f34 100644 --- a/source/nan_compile.mk +++ b/source/nan_compile.mk @@ -73,15 +73,18 @@ ifeq ($(OS),darwin) CC ?= gcc CCC ?= g++ ifeq ($(CPU),powerpc) - CFLAGS += -pipe -fPIC -ffast-math -mcpu=7450 -mtune=G5 -funsigned-char -fno-strict-aliasing -Wno-long-double - CCFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -Wno-long-double + CFLAGS += -pipe -fPIC -ffast-math -mcpu=7450 -mtune=G5 -funsigned-char -fno-strict-aliasing + CCFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -wno-long-double else CFLAGS += -pipe -fPIC -ffast-math -march=pentium-m -funsigned-char -fno-strict-aliasing - CCFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing + CCFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -wno-long-double endif # REL_CFLAGS += -O # REL_CCFLAGS += -O2 CPPFLAGS += -D_THREAD_SAFE + ifeq ($(WITH_COCOA), true) + CPPFLAGS += -DGHOST_COCOA + endif NAN_DEPEND = true OPENGL_HEADERS = /System/Library/Frameworks/OpenGL.framework AR = ar @@ -307,6 +310,20 @@ $(DIR)/$(DEBUG_DIR)%.o: %.cpp $(CCC) -c $(CCFLAGS) $(CPPFLAGS) $< -o $@ endif +$(DIR)/$(DEBUG_DIR)%.o: %.mm + ifdef NAN_DEPEND + @set -e; $(CC) -M $(CPPFLAGS) $< 2>/dev/null \ + | sed 's@\($*\)\.o[ :]*@$(DIR)/$(DEBUG_DIR)\1.o : @g' \ + > $(DIR)/$(DEBUG_DIR)$*.d; \ + [ -s $(DIR)/$(DEBUG_DIR)$*.d ] || $(RM) $(DIR)/$(DEBUG_DIR)$*.d + endif + ifdef NAN_QUIET + @echo " -- $< -- " + @$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ + else + $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ + endif + $(DIR)/$(DEBUG_DIR)%.res: %.rc ifeq ($(FREE_WINDOWS),true) windres $< -O coff -o $@ @@ -332,16 +349,18 @@ CCSRCS ?= $(wildcard *.cpp) JSRCS ?= $(wildcard *.java) ifdef NAN_DEPEND --include $(CSRCS:%.c=$(DIR)/$(DEBUG_DIR)%.d) $(CCSRCS:%.cpp=$(DIR)/$(DEBUG_DIR)%.d) +-include $(CSRCS:%.c=$(DIR)/$(DEBUG_DIR)%.d) $(CCSRCS:%.cpp=$(DIR)/$(DEBUG_DIR)%.d) $(OCSRCS:$.mm=$(DIR)/$(DEBUG_DIR)%.d) endif OBJS_AR := $(OBJS) OBJS_AR += $(CSRCS:%.c=%.o) OBJS_AR += $(CCSRCS:%.cpp=%.o) +OBJS_AR += $(OCSRCS:%.mm=%.o) OBJS_AR += $(WINRC:%.rc=%.res) OBJS += $(CSRCS:%.c=$(DIR)/$(DEBUG_DIR)%.o) OBJS += $(CCSRCS:%.cpp=$(DIR)/$(DEBUG_DIR)%.o) +OBJS += $(OCSRCS:%.mm=$(DIR)/$(DEBUG_DIR)%.o) OBJS += $(WINRC:%.rc=$(DIR)/$(DEBUG_DIR)%.res) JCLASS += $(JSRCS:%.java=$(DIR)/$(DEBUG_DIR)%.class) |