From: <sv...@ww...> - 2004-08-07 16:58:24
|
Author: mkrose Date: 2004-08-07 09:58:15 -0700 (Sat, 07 Aug 2004) New Revision: 1206 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Source/Makefile.in Log: Modified Makefile.in to generate object files under Source/.objs rather than alongside the source files. Other small makefile cleanups. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1206 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2004-08-07 15:54:11 UTC (rev 1205) +++ trunk/CSP/CSPSim/CHANGES.current 2004-08-07 16:58:15 UTC (rev 1206) @@ -5,6 +5,10 @@ * Cleaned up tree images a bit to remove purple pixels. Converted tree0.rgba to png. Adjusted the aspect ratios slightly. + * Modified Makefile.in to generate object files under Source/.objs + rather than alongside the source files. Other small makefile + cleanups. + 2004-08-06: onsight * Fixed a pseudo-bug in demeter, which caused terrain height anomalies at the edges of flat and rough terrain blocks. Essentially, when a Modified: trunk/CSP/CSPSim/Source/Makefile.in =================================================================== --- trunk/CSP/CSPSim/Source/Makefile.in 2004-08-07 15:54:11 UTC (rev 1205) +++ trunk/CSP/CSPSim/Source/Makefile.in 2004-08-07 16:58:15 UTC (rev 1206) @@ -31,6 +31,9 @@ STATIC_LIB = libcspsim_static.a WRAPED_LIB = _cCSP.so +INTERFACES = \ + cCSP.i + SOURCES = \ Systems/AircraftFlightSensors.cpp \ Systems/AircraftInputSystem.cpp \ @@ -114,14 +117,17 @@ VirtualBattlefield.cpp \ VirtualScene.cpp -OBJECTS = $(SOURCES:%.cpp=%.o) +OBJDIR = .objs +OBJECTS = $(SOURCES:%.cpp=$(OBJDIR)/%.o) +OBJ_MAGIC := $(shell mkdir $(OBJDIR) $(addprefix $(OBJDIR)/,$(SUBDIRS)) > /dev/null 2>&1 || :) DEPDIR = .deps MKDEP = $(CXX) -M $(CFLAGS) SWDEP = $(SWIG) -M $(SWOPTS) -DEPFILES = $(addprefix $(DEPDIR)/,$(addsuffix .d, $(SOURCES))) $(DEPDIR)/cCSP.i.swigdep -DEPFILTER = -DEPS_MAGIC := $(shell mkdir $(DEPDIR) $(DEPDIR)/Theater $(DEPDIR)/Systems $(DEPDIR)/SimNet $(DEPDIR)/Views > /dev/null 2>&1 || :) +DEPFILES = $(addprefix $(DEPDIR)/,$(addsuffix .d, $(SOURCES))) \ + $(addprefix $(DEPDIR)/,$(addsuffix .swigd, $(INTERFACES))) +DEPFILTER = | sed -n 's/^\(.*:\)/$(OBJDIR)\/\1/;p' +DEP_MAGIC := $(shell mkdir $(DEPDIR) $(addprefix $(DEPDIR)/,$(SUBDIRS)) > /dev/null 2>&1 || :) .PHONY: clean-deps clean all default @@ -129,16 +135,14 @@ @echo "run make from top-level directory only" clean-objects: - rm -f $(SOURCES:%.cpp=%.o) - rm -f lib*.a - rm -f $(BIN)/_cCSP.so $(BIN)/cCSP.py cCSP_wrap.* + ${RM} -fr $(OBJDIR) + ${RM} -f lib*.a + ${RM} -f $(BIN)/_cCSP.so $(BIN)/cCSP.py cCSP_wrap.* -clean-dependencies: - @echo +clean-deps clean-dependencies: find $(DEPDIR) -name *.d -exec ${RM} {} \; + find $(DEPDIR) -name *.swigd -exec ${RM} {} \; -clean-deps: clean-dependencies - clean: clean-deps clean-objects ifeq ($(findstring clean,$(MAKECMDGOALS)),) @@ -147,23 +151,13 @@ endif endif -#clean clean-deps: -# for dir in $(SUBDIRS); do \ -# $(MAKE) -C $${dir} $@; \ -# done - -build-subdirs: -# @for dir in $(SUBDIRS); do \ -# $(MAKE) -C $${dir} all; \ -# done - $(DEPDIR)/%.d : % @echo "Computing dependencies for $<..." - @$(MKDEP) $< $(DEPFILTER) | sed -e 's!^[a-zA-Z0-9_]*.o:!$(<:%.cpp=%.o):!' > $@ + @$(MKDEP) $< $(DEPFILTER) > $@ -$(DEPDIR)/%.swigdep : % +$(DEPDIR)/%.swigd : % @echo "Computing dependencies for $<..." - @$(SWDEP) $(DEPFILTER) -o $(<:.i=_wrap.cpp) $< > $@ + @$(SWDEP) -o $(<:.i=_wrap.cpp) $< $(DEPFILTER) > $@ $(WRAPED_LIB) : $(OBJECTS) cCSP_wrap.o $(CXX) $(LDOPTS) -o$@ $^ $(LIBS) @@ -196,11 +190,11 @@ test: clientNode serverNode -%.o: %.cpp - $(CXX) -c $(CFLAGS) -o $@ $(@:.o=.cpp) +$(OBJDIR)/%.o: %.cpp + $(CXX) -c $(CFLAGS) -o $@ $< -AeroDynamics.o: AeroDynamics.cpp - $(CXX) -c $(CFLAGS) -O3 $(@:.o=.cpp) +$(OBJDIR)/AeroDynamics.o: AeroDynamics.cpp + $(CXX) -c $(CFLAGS) -O3 -o $@ $< #ClientNodeDriver.o: ClientNodeDriver.cpp # $(CXX) -c $(CFLAGS) $(INCLUDE) -o ClientNodeDriver.o ClientNodeDriver.cpp @@ -211,5 +205,5 @@ Makefile: Makefile.in cd $(TOPDIR) && ./configure -all: Makefile build-subdirs $(WRAPED_LIB) #$(STATIC_LIB) test #CSPapp +all: Makefile $(WRAPED_LIB) #$(STATIC_LIB) test #CSPapp |