${Q2}${CXX} ${CXXFLAGS} -c -o $@ $<
# rule to make a depend file from a .cpp
+# be clever and escape the / chars in file paths
+# DON'T simply use another sed delimiter or it can't appear in the file paths
${DEPSDIR}%.d: ${SRCSDIR}%.cpp | ${DEPSBLDDIRS}
${Q1}echo "DEP: $@"
- ${Q2}${CXX} -MM ${CXXFLAGS} $< | sed 's,\(^.*\):,${OBJSDIR}\1 $@:,' > $@
+ ${Q2}${CXX} -MM ${CXXFLAGS} $< | \
+ sed 's/\(^.*\):/$(subst /,\/,${OBJSDIR}\1 $@):/' > $@
# rule to copy the config files into the working directory
${DSTCFGDIR}%.cfg: ${SRCCFGDIR}%.cfg | ${DSTCFGDIR}
.PHONY: gitclean
gitclean:
- ${Q1}echo "git-clean: show, use gitcleanf to force"
- ${Q2}cd ..; git clean -nxd
+ ${Q1}echo "git clean: showing; use gitcleanf to force removal"
+ ${Q2}git clean -nxd
.PHONY: gitcleanf
gitcleanf:
- ${Q1}echo "git-clean: forced"
- ${Q2}cd ..; git clean -fxd
+ ${Q1}echo "git clean: forcing"
+ ${Q2}git clean -fxd
.PHONY: tar
-tar: ../physics.tar.bz2
+tar: physics.tar.bz2
-.PHONY: ../physics.tar.bz2
-../physics.tar.bz2:
+.PHONY: physics.tar.bz2
+physics.tar.bz2:
@echo "git-archive: Warning, archives HEAD not current"
- ${Q1}echo "git-archive: ../physics.tar.bz2"
- ${Q2}cd ..; git-archive --prefix=physics/ HEAD | bzip2 > physics.tar.bz2
+ ${Q1}echo "git-archive: physics.tar.bz2"
+ ${Q2}git-archive --prefix=physics/ HEAD | bzip2 > physics.tar.bz2
.PHONY: run
run: all
"LIBSDL := `/usr/mingw32/bin/sdl-config --libs`" \
"CXXFLAGS := ${OPTFLAGS}" \
"CXX := mingw32-g++" \
- "OBJSDIR := ../objs-mingw32/" \
- "WORKINGDIR := ../bin-mingw32/" \
+ "OBJSDIR := objs-mingw32/" \
+ "WORKINGDIR := bin-mingw32/" \
"TARGETNAME := run_physics.exe"
.PHONY: mingw32
${Q2}${MAKE} ${MINGMAKEARGS} clean all
FINALMAKEARGS := "CXXFLAGS := ${OPTFLAGS}" \
- "OBJSDIR := ../objs/" \
- "WORKINGDIR := ../bin/"
+ "OBJSDIR := objs/" \
+ "WORKINGDIR := bin/"
.PHONY: final
final: