diff --git a/examples/Makefile b/examples/Makefile index 072b2d80a1c7367490cc3c37daaf42ab0d492861..703525570659eb5b38cbe340d08d6b9bb76dd120 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -1,18 +1,25 @@ +SUBDIRS=duck_typing dynamic jgrafchart robot simple tcp \ + twoway user_types wiki_example + .PHONY: all all: - echo To be done... + echo More to be done... $(MAKE) -C twoway all .PHONY: test test: echo More to be done... cd simple ; sh compile.sh && sh run.sh - $(MAKE) -C twoway test $(MAKE) -C duck_typing test + $(MAKE) -C twoway test + +.PHONY: clean +clean: $(SUBDIRS:%=clean-%) +clean-%: + $(MAKE) -C $* clean -.PHONY: clean distclean -clean distclean: - echo To be done... - $(MAKE) -C twoway clean - $(MAKE) -C duck_typing clean +.PHONY: distclean +distclean: $(SUBDIRS:%=distclean-%) +distclean-%: + $(MAKE) -C $* distclean diff --git a/examples/dynamic/Makefile b/examples/dynamic/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..607a20a97e9bcdab4a3951690e38322c5d650af7 --- /dev/null +++ b/examples/dynamic/Makefile @@ -0,0 +1,5 @@ +all: + +clean: + +distclean: diff --git a/examples/jgrafchart/Makefile b/examples/jgrafchart/Makefile index 08a82396edeb458a702b8ac96d3e7bd9b041df78..fc468e905b01964b69d1b68d73d1887502bb88e0 100644 --- a/examples/jgrafchart/Makefile +++ b/examples/jgrafchart/Makefile @@ -24,9 +24,11 @@ ${JAVA_PKG}/client/TestClient.class: ${JAVA_PKG}/client/TestClient.java ${JAVA_P javac -cp ${CLASSPATH} $< +.PHONY: runjavaserver runjavaserver : ${JAVA_PKG}/server/TestServer.class java -cp ${CLASSPATH} $(<:.class=) +.PHONY: runjavaclient runjavaclient : ${JAVA_PKG}/client/TestClient.class java -cp ${CLASSPATH} $(<:.class=) @@ -47,16 +49,23 @@ ${TLCFILE}.c : ${TLCFILE}.lc all: client testserver ${JAVA_PKG}/server/TestServer.class ${JAVA_PKG}/client/TestClient.class turtleclient -.PHONY: clean runclient runserver runjavaserver runjavaclient turtleclient +.PHONY: clean clean : - rm ${LCFILE}.c ${LCFILE}.h client testserver turtleclient - rm ${JAVA_PKG}/server/*.class ${JAVA_PKG}/client/*.class ${JAVA_PKG}/gen/* + rm -f ${LCFILE}.c ${LCFILE}.h client testserver turtleclient + rm -f ${JAVA_PKG}/server/*.class ${JAVA_PKG}/client/*.class + rm -f ${JAVA_PKG}/gen/* +.PHONY: distclean +distclean: clean + +.PHONY: runclient runclient : client LD_LIBRARY_PATH=${LCLIBDIR} ./$< localhost 9999 +.PHONY: runserver runserver : testserver LD_LIBRARY_PATH=${LCLIBDIR} ./$< 9999 +.PHONY: runtclient runtclient : turtleclient LD_LIBRARY_PATH=${LCLIBDIR} ./$< localhost 8082 diff --git a/examples/robot/Makefile b/examples/robot/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..607a20a97e9bcdab4a3951690e38322c5d650af7 --- /dev/null +++ b/examples/robot/Makefile @@ -0,0 +1,5 @@ +all: + +clean: + +distclean: diff --git a/examples/simple/Makefile b/examples/simple/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..757301e818275ec4ae55c10514b825483b2ce0b8 --- /dev/null +++ b/examples/simple/Makefile @@ -0,0 +1,6 @@ +all: + +clean: + +distclean: + rm -rf gen diff --git a/examples/tcp/Makefile b/examples/tcp/Makefile index da81761ace6272ff2aa381b146b9b81943393ad0..a96c0e1acc2f62d9a67fc4400a0b0e99ae4bda5b 100644 --- a/examples/tcp/Makefile +++ b/examples/tcp/Makefile @@ -51,4 +51,8 @@ runclient : ${JAVA_PKG}/client/TestClient.class java -cp ${CLASSPATH} $(<:.class=) 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 diff --git a/examples/twoway/Makefile b/examples/twoway/Makefile index 60b5708efd2d48df21b41e87b19e9d2eb1534161..868966d6212b28ea8ef783304c128e04d4a52dbd 100644 --- a/examples/twoway/Makefile +++ b/examples/twoway/Makefile @@ -32,8 +32,8 @@ gen/server: server.c $(CC) -o $@ $(CFLAGS) $^ -lpthread \ -L../../lib/c -llabcomm -.PHONY: clean -clean: +.PHONY: clean distclean +clean distclean: rm -rf gen gen/decimating.o: decimating.h diff --git a/examples/user_types/Makefile b/examples/user_types/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..607a20a97e9bcdab4a3951690e38322c5d650af7 --- /dev/null +++ b/examples/user_types/Makefile @@ -0,0 +1,5 @@ +all: + +clean: + +distclean: diff --git a/examples/wiki_example/Makefile b/examples/wiki_example/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..607a20a97e9bcdab4a3951690e38322c5d650af7 --- /dev/null +++ b/examples/wiki_example/Makefile @@ -0,0 +1,5 @@ +all: + +clean: + +distclean: diff --git a/lib/c/Makefile b/lib/c/Makefile index 37dbba9a3bc0fc9055d8ad0433689fba742c363f..43e892ff1f7d3b5c942083e287c5d227c75636d9 100644 --- a/lib/c/Makefile +++ b/lib/c/Makefile @@ -168,6 +168,7 @@ clean: $(RM) test/test_labcomm_errors $(RM) test/testdata/gen/*.[cho] $(RM) test/gen/*.[cho] + -rmdir test/gen for x in $(TESTS); do \ $(RM) $(TEST_DIR)/$$x ; \ done