From d173793d5d166628c459ae65259bf8ef092dc4b0 Mon Sep 17 00:00:00 2001 From: pixel Date: Sat, 22 Oct 2005 00:19:23 +0000 Subject: Adding that funky auto-dependancy system :) --- compile/macosX/Makefile | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'compile') diff --git a/compile/macosX/Makefile b/compile/macosX/Makefile index 72e31d7..f862add 100644 --- a/compile/macosX/Makefile +++ b/compile/macosX/Makefile @@ -10,7 +10,7 @@ INCLUDES = \ -I../../mogltk/include \ -I../.. -CPPFLAGS = $(INCLUDES) -O4 -DSTDC_HEADERS -DREADLINE_STATIC -DHAVE_UNISTD_H -fexceptions `sdl-config --cflags` +CPPFLAGS = $(INCLUDES) -O4 -DSTDC_HEADERS -DREADLINE_STATIC -DHAVE_UNISTD_H -fexceptions `sdl-config --cflags` -DWORDS_BIGENDIAN LDFLAGS = -O4 `sdl-config --libs` @@ -19,7 +19,8 @@ vpath %.cc ../../Dalos:../../:../../mogltk/lib:../../generic/lib:../../lib:../.. vpath %.cpp ../../Dalos:../../:../../mogltk/lib:../../generic/lib:../../lib:../../psxdev:../../generic/lib/zlib/src:../../generic/lib/lua/src:../../generic/lib/lua/src/LuaLib SOURCES = \ -Dalos.cc cd-tool.cpp +cd-tool.cpp +#Dalos.cpp MOGLTK_SOURCES = \ base.cc glwidgets.cc \ @@ -95,15 +96,18 @@ $(HASH_SOURCES) WHOLE_SOURCES = $(SOURCES) $(COMMON_SOURCES) $(MOGLTK_SOURCES) ALL_OBJECTS = $(addsuffix .o, $(notdir $(basename $(WHOLE_SOURCES)))) +ALL_DEPS = $(addsuffix .dep, $(notdir $(basename $(WHOLE_SOURCES)))) DALOS_OBJECTS = $(addsuffix .o, $(notdir $(basename $(COMMON_SOURCES) $(MOGLTK_SOURCES)))) Dalos.o CD_TOOL_OBJECTS = $(addsuffix .o, $(notdir $(basename $(COMMON_SOURCES)))) cd-tool.o -all: cd-tool +all: dep cd-tool -stats: - @wc $(WHOLE_SOURCES) +dep: $(ALL_DEPS) + +#stats: +# @wc $(WHOLE_SOURCES) dist: all ../../cd-tool.lua ../../FAQ-cd.txt ../../COPYING zip -j9 ../cd-tool-`date +%Y%m%d`-linux-dynamic.zip cd-tool ../../cd-tool.lua ../../FAQ-cd.txt ../../COPYING @@ -128,7 +132,7 @@ cd-tool-static: $(CD_TOOL_OBJECTS) $(STRIP) cd-tool-static clean: - rm -f Dalos Dalos-static cd-tool cd-tool-static *.o + rm -f Dalos Dalos-static cd-tool cd-tool-static *.o *.dep @@ -144,3 +148,15 @@ clean: #endef # #$(foreach src, $(WHOLE_SOURCES), $(if $(filter %.c, $(src)), $(eval $(call OBJECT_C_template, $(src))), $(eval $(call OBJECT_CXX_template, $(src))))) + + +%.dep : %.c + $(CC) $(CPPFLAGS) -M -MF $@ $< + +%.dep : %.cpp + $(CXX) $(CPPFLAGS) -M -MF $@ $< + +%.dep : %.cc + $(CXX) $(CPPFLAGS) -M -MF $@ $< + +-include $(ALL_DEPS) -- cgit v1.2.3