Changeset 2102 for trunk/source/Makefile
- Timestamp:
- 06/05/08 17:08:44 (7 months ago)
- Files:
-
- 1 modified
-
trunk/source/Makefile (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Makefile
r1920 r2102 10 10 LDLIBS= 11 11 SRCDIR=. 12 OBJEXT=o 13 LIBEXT=a 14 15 # include a configuration file if one exists (or carry on without 16 # worrying if it doesn't) 17 -include Makefile.conf 12 18 13 19 main := maincl.cpp … … 17 23 libsource := ${filter-out ${main},${source}} 18 24 includes := ${notdir ${wildcard ${SRCDIR}/*.h}} 19 objects := ${source:.cpp=.o} 20 libobjects := ${libsource:.cpp=.o} 21 testobjects := ${testsource:.cpp=.o} 22 23 # include a configuration file if one exists (or carry on without 24 # worrying if it doesn't) 25 -include Makefile.conf 25 objects := ${source:.cpp=.${OBJEXT}} 26 libobjects := ${libsource:.cpp=.${OBJEXT}} 27 testobjects := ${testsource:.cpp=.${OBJEXT}} 26 28 27 29 ifneq (${SRCDIR},.) … … 93 95 CXXFLAGS += -DSVN_REVISION=\"$(REVISION)\" 94 96 95 cloudy.exe : ${preobjects} maincl. o libcloudy.a96 ${CXX} ${LDFLAGS} -o cloudy.exe maincl. o-L. -lcloudy ${LDLIBS}97 cloudy.exe : ${preobjects} maincl.${OBJEXT} libcloudy.${LIBEXT} 98 ${CXX} ${LDFLAGS} -o cloudy.exe maincl.${OBJEXT} -L. -lcloudy ${LDLIBS} 97 99 98 libcloudy. a: ${libobjects}99 ar ru libcloudy. a${libobjects}100 ${RANLIB} libcloudy. a100 libcloudy.${LIBEXT}: ${libobjects} 101 ar ru libcloudy.${LIBEXT} ${libobjects} 102 ${RANLIB} libcloudy.${LIBEXT} 101 103 102 104 clean : 103 rm -f *. o105 rm -f *.${OBJEXT} 104 106 rm -f *.h.gch 105 107 rm -rf SunWS_cache 106 rm -f libcloudy. a108 rm -f libcloudy.${LIBEXT} 107 109 rm -f cloudy.exe 108 110 rm -f runtests.exe 109 111 110 112 distclean : 111 rm -f *. o113 rm -f *.${OBJEXT} 112 114 rm -f *.h.gch 113 115 rm -rf SunWS_cache 114 rm -f libcloudy. a116 rm -f libcloudy.${LIBEXT} 115 117 rm -f cloudy.exe 116 118 rm -f runtests.exe … … 125 127 @echo "Updating dependency file, this may take a little while" 126 128 @cd ${SRCDIR}; \ 127 ${CXXDEPEND} -MM -DMM ${CXXDEFINES} ${source} | sed "s/${presource}/${substname}/" > $(PWD)/Makefile.dep; \128 ${CXXDEPEND} -MM -DMM ${CXXDEFINES} ${testsource} | sed "s/${presource}/${substname}/" >> $(PWD)/Makefile.dep; \129 ${CXXDEPEND} -MM -DMM ${CXXDEFINES} ${presource} | sed 's/\.o:/.h.gch:/' >> $(PWD)/Makefile.dep;129 ${CXXDEPEND} -MM -DMM ${CXXDEFINES} ${source} | sed "s/${presource}/${substname}/" | sed "s/\.o/.${OBJEXT}/" > "$(PWD)/Makefile.dep"; \ 130 ${CXXDEPEND} -MM -DMM ${CXXDEFINES} ${testsource} | sed "s/${presource}/${substname}/" | sed "s/\.o/.${OBJEXT}/" >> "$(PWD)/Makefile.dep"; \ 131 ${CXXDEPEND} -MM -DMM ${CXXDEFINES} ${presource} | sed 's/\.o:/.h.gch:/' >> "$(PWD)/Makefile.dep"; 130 132 131 cpu. o:133 cpu.${OBJEXT}: 132 134 ${CXX} ${CXXFLAGS} -c -DCLOUDY_DATA_PATH=\"${CDP}\" $< 133 135 134 136 # an explicit -O0 is needed for some compilers like icc 135 parse_crashdo. o:137 parse_crashdo.${OBJEXT}: 136 138 ${CXX} ${CXXFLAGSNOOPT} -O0 -c $< 137 139 … … 145 147 valgrind --leak-check=full --track-fds=yes ./runtests.exe 146 148 147 runtests.exe: ${testobjects} libcloudy. a148 ${CXX} ${CXXFLAGS} - o $@ ${filter-out %.a, $^} \149 runtests.exe: ${testobjects} libcloudy.${LIBEXT} 150 ${CXX} ${CXXFLAGS} -${OBJEXT} $@ ${filter-out %.${LIBEXT}, $^} \ 149 151 ${LDFLAGS} -L. -lcloudy -Llib -lUnitTest++ ${LDLIBS} 150 152 151 153 ${testobjects}: CXXFLAGS += -I${SRCDIR}/include/UnitTest++ 152 154 153 ${testobjects}: lib/libUnitTest++. a155 ${testobjects}: lib/libUnitTest++.${LIBEXT} 154 156 155 lib/libUnitTest++. a:157 lib/libUnitTest++.${LIBEXT}: 156 158 cd ${SRCDIR}/../library/UnitTest++; \ 157 159 $(MAKE) clean; $(MAKE) CC=${CXX} CCFLAGS="${CXXFLAGS}"; \ … … 161 163 cp src/Win32/*.h ${PWD}/include/UnitTest++/Win32; \ 162 164 cp src/Posix/*.h ${PWD}/include/UnitTest++/Posix; \ 163 cp libUnitTest++. a${PWD}/lib/165 cp libUnitTest++.${LIBEXT} ${PWD}/lib/ 164 166 165 167 # only include Makefile.dep when we really need it, this prevents unnecessary builds of Makefile.dep
