diff options
author | Thomas O Fredericks <mrtof@users.sourceforge.net> | 2010-10-14 18:58:53 +0000 |
---|---|---|
committer | Thomas O Fredericks <mrtof@users.sourceforge.net> | 2010-10-14 18:58:53 +0000 |
commit | 691cfbc1341246a1d8d632a100e989ed94debc5e (patch) | |
tree | 3bf50217bbd58cbf007a316c6732a8b1fd9ae6fc /src/Makefile | |
parent | fed569060c1f10dc85302caa518fcdbcabef000a (diff) |
Updated my Makefile
svn path=/trunk/externals/tof/; revision=14227
Diffstat (limited to 'src/Makefile')
-rw-r--r-- | src/Makefile | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/src/Makefile b/src/Makefile index 02ed017..012189d 100644 --- a/src/Makefile +++ b/src/Makefile @@ -65,13 +65,19 @@ export MACOSX_DEPLOYMENT_TARGET = 10.3 ALL = $(patsubst %.c,%.$(EXTENSION),$(wildcard *.c)) default: $(ALL) +clean: + rm *.$(EXTENSION) + .SUFFIXES: .$(EXTENSION) .$(SHARED_LIB) +CCWARNINGS = -Waddress -Wchar-subscripts -Wimplicit-int -Wimplicit-function-declaration -Wcomment -Wformat -Wmain -Wmissing-braces -Wnonnull -Wparentheses -Wpointer-sign -Wreturn-type -Wsequence-point -Wsign-compare -Wstrict-aliasing -Wstrict-overflow=1 -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused-label -Wunused-value -Wvolatile-register-var # this variable is to support old "win" directories, rather than "windows" BUILDSRC_OS_NAME = $(OS_NAME) -CFLAGS = -DPD -I$(PD_SRC)/src -Wall -W $(DEBUG_CFLAGS) +#-Wall -W $(DEBUG_CFLAGS) + +CFLAGS = -DPD -I$(PD_SRC)/src $(CCWARNINGS) LDFLAGS = LIBS = -lm @@ -82,7 +88,7 @@ ifeq ($(OS_NAME),darwin) # FAT_FLAGS = -arch ppc -arch ppc7400 -arch ppc64 -arch i386 -arch x86_64 CFLAGS += -I/sw/include -DMACOSX -DUNIX -Dunix -DDL_OPEN -arch $(ARCH) LDFLAGS += -bundle -bundle_loader $(PD_BIN)/bin/pd -undefined dynamic_lookup \ - -L/sw/lib -weak_framework Carbon -arch $(ARCH) + -weak_framework Carbon -arch $(ARCH) LIBS += -lc DYLIB_LDFLAGS = -dynamiclib -undefined dynamic_lookup -read_only_relocs warning -L/sw/lib STRIP = strip -x @@ -114,6 +120,8 @@ endif CXXFLAGS = $(CFLAGS) + + ### C++ files %.$(EXTENSION): %.cpp %.$(EXTENSION): %.cc @@ -122,7 +130,7 @@ CXXFLAGS = $(CFLAGS) chmod a-x "$*.$(EXTENSION)" # $(STRIP) $*.$(EXTENSION) # rm -f -- $*.o - mv $*.$(EXTENSION) $(OUTPUT) + cp $*.$(EXTENSION) $(OUTPUT) %.o: %.cpp %.o: %.cc @@ -131,19 +139,21 @@ CXXFLAGS = $(CFLAGS) ### C files %.o: %.c - $(CC) $(OPT_CFLAGS) $(CFLAGS) -o "$*.o" -c "$*.c" + @echo "- Building $*.o" + @$(CC) $(OPT_CFLAGS) $(CFLAGS) -o "$*.o" -c "$*.c" %.$(EXTENSION): %.o - $(CC) $(LDFLAGS) -o "$*.$(EXTENSION)" "$*.o" $(LIBS) \ + @echo "- Linking $*.$(EXTENSION)" + @$(CC) $(LDFLAGS) -o "$*.$(EXTENSION)" "$*.o" $(LIBS) \ `test -f $*.libs && cat $*.libs` \ `my_dylib=$(patsubst $(externals_src)/%,%,$(@D)); test -f $(@D)/lib$${my_dylib}.$(DYLIB_EXTENSION) && echo -L$(@D) -l$$my_dylib` \ `my_obj=$(patsubst $(externals_src)/%,%,$(@D)); test -f $(@D)/shared/$${my_obj}.o && echo $(@D)/shared/$${my_obj}.o` \ `test -f $(dir $*)../$(BUILDSRC_OS_NAME)/$(notdir $*).libs && \ cat $(dir $*)../$(BUILDSRC_OS_NAME)/$(notdir $*).libs` - chmod a-x "$*.$(EXTENSION)" - $(STRIP) $*.$(EXTENSION) - rm -f -- $*.o - mv $*.$(EXTENSION) $(OUTPUT) + @chmod a-x "$*.$(EXTENSION)" + @$(STRIP) $*.$(EXTENSION) + @rm -f -- $*.o + @cp $*.$(EXTENSION) $(OUTPUT) |