Skip to content
Snippets Groups Projects
Commit 36ec36fc authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Added rules for proper 'make clean ; make distclean' in examples

Added some extra cleaning in lib/c/Makefile
parent 073a15e1
No related branches found
No related tags found
No related merge requests found
SUBDIRS=duck_typing dynamic jgrafchart robot simple tcp \
twoway user_types wiki_example
.PHONY: all .PHONY: all
all: all:
echo To be done... echo More to be done...
$(MAKE) -C twoway all $(MAKE) -C twoway all
.PHONY: test .PHONY: test
test: test:
echo More to be done... echo More to be done...
cd simple ; sh compile.sh && sh run.sh cd simple ; sh compile.sh && sh run.sh
$(MAKE) -C twoway test
$(MAKE) -C duck_typing test $(MAKE) -C duck_typing test
$(MAKE) -C twoway test
.PHONY: clean
clean: $(SUBDIRS:%=clean-%)
clean-%:
$(MAKE) -C $* clean
.PHONY: clean distclean .PHONY: distclean
clean distclean: distclean: $(SUBDIRS:%=distclean-%)
echo To be done... distclean-%:
$(MAKE) -C twoway clean $(MAKE) -C $* distclean
$(MAKE) -C duck_typing clean
all:
clean:
distclean:
...@@ -24,9 +24,11 @@ ${JAVA_PKG}/client/TestClient.class: ${JAVA_PKG}/client/TestClient.java ${JAVA_P ...@@ -24,9 +24,11 @@ ${JAVA_PKG}/client/TestClient.class: ${JAVA_PKG}/client/TestClient.java ${JAVA_P
javac -cp ${CLASSPATH} $< javac -cp ${CLASSPATH} $<
.PHONY: runjavaserver
runjavaserver : ${JAVA_PKG}/server/TestServer.class runjavaserver : ${JAVA_PKG}/server/TestServer.class
java -cp ${CLASSPATH} $(<:.class=) java -cp ${CLASSPATH} $(<:.class=)
.PHONY: runjavaclient
runjavaclient : ${JAVA_PKG}/client/TestClient.class runjavaclient : ${JAVA_PKG}/client/TestClient.class
java -cp ${CLASSPATH} $(<:.class=) java -cp ${CLASSPATH} $(<:.class=)
...@@ -47,16 +49,23 @@ ${TLCFILE}.c : ${TLCFILE}.lc ...@@ -47,16 +49,23 @@ ${TLCFILE}.c : ${TLCFILE}.lc
all: client testserver ${JAVA_PKG}/server/TestServer.class ${JAVA_PKG}/client/TestClient.class turtleclient all: client testserver ${JAVA_PKG}/server/TestServer.class ${JAVA_PKG}/client/TestClient.class turtleclient
.PHONY: clean runclient runserver runjavaserver runjavaclient turtleclient .PHONY: clean
clean : clean :
rm ${LCFILE}.c ${LCFILE}.h client testserver turtleclient rm -f ${LCFILE}.c ${LCFILE}.h client testserver turtleclient
rm ${JAVA_PKG}/server/*.class ${JAVA_PKG}/client/*.class ${JAVA_PKG}/gen/* rm -f ${JAVA_PKG}/server/*.class ${JAVA_PKG}/client/*.class
rm -f ${JAVA_PKG}/gen/*
.PHONY: distclean
distclean: clean
.PHONY: runclient
runclient : client runclient : client
LD_LIBRARY_PATH=${LCLIBDIR} ./$< localhost 9999 LD_LIBRARY_PATH=${LCLIBDIR} ./$< localhost 9999
.PHONY: runserver
runserver : testserver runserver : testserver
LD_LIBRARY_PATH=${LCLIBDIR} ./$< 9999 LD_LIBRARY_PATH=${LCLIBDIR} ./$< 9999
.PHONY: runtclient
runtclient : turtleclient runtclient : turtleclient
LD_LIBRARY_PATH=${LCLIBDIR} ./$< localhost 8082 LD_LIBRARY_PATH=${LCLIBDIR} ./$< localhost 8082
all:
clean:
distclean:
all:
clean:
distclean:
rm -rf gen
...@@ -51,4 +51,8 @@ runclient : ${JAVA_PKG}/client/TestClient.class ...@@ -51,4 +51,8 @@ runclient : ${JAVA_PKG}/client/TestClient.class
java -cp ${CLASSPATH} $(<:.class=) java -cp ${CLASSPATH} $(<:.class=)
clean : clean :
rm ${JAVA_PKG}/server/*.class ${JAVA_PKG}/client/*.class ${JAVA_PKG}/gen/* rm -f ${JAVA_PKG}/server/*.class
rm -f ${JAVA_PKG}/client/*.class
rm -f ${JAVA_PKG}/gen/*
distclean: clean
...@@ -32,8 +32,8 @@ gen/server: server.c ...@@ -32,8 +32,8 @@ gen/server: server.c
$(CC) -o $@ $(CFLAGS) $^ -lpthread \ $(CC) -o $@ $(CFLAGS) $^ -lpthread \
-L../../lib/c -llabcomm -L../../lib/c -llabcomm
.PHONY: clean .PHONY: clean distclean
clean: clean distclean:
rm -rf gen rm -rf gen
gen/decimating.o: decimating.h gen/decimating.o: decimating.h
......
all:
clean:
distclean:
all:
clean:
distclean:
...@@ -168,6 +168,7 @@ clean: ...@@ -168,6 +168,7 @@ clean:
$(RM) test/test_labcomm_errors $(RM) test/test_labcomm_errors
$(RM) test/testdata/gen/*.[cho] $(RM) test/testdata/gen/*.[cho]
$(RM) test/gen/*.[cho] $(RM) test/gen/*.[cho]
-rmdir test/gen
for x in $(TESTS); do \ for x in $(TESTS); do \
$(RM) $(TEST_DIR)/$$x ; \ $(RM) $(TEST_DIR)/$$x ; \
done done
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment