DEMOS = dumper \ dummyLamp lampCommander \ thermoPC thermoWatch \ dummyDimmer dummyShutter \ tattler \ azerty CFLAGS = -Wall -I. -g -O0 LDLIBS = -L. -lxaal -lcbor -luuid -lsodium all: $(DEMOS) thermoPC: thermoPC.c $(LINK.c) $^ $(LOADLIBES) -lsensors $(LDLIBS) -o $@ azerty: azerty.c $(LINK.c) $^ $(LOADLIBES) -ljson-c $(LDLIBS) -o $@ tattler: tattler.c $(LINK.c) $^ $(LOADLIBES) -ljson-c -lmnl $(LDLIBS) -o $@ clean: -rm -f *.o *~ proper: clean -rm -f $(DEMOS) SHELL = /bin/bash test: all @echo " " You can test $(DEMOS) @echo " " First, do: export LD_LIBRARY_PATH+=:. @echo " " Then, eg.: @/bin/echo -e "" $(foreach i,$(DEMOS)," ./$(i) -a 224.0.29.200 -p 1236 -s my_secret\n") DEMO2 = thermoPC dummyLamp dumper dummyDimmer dummyShutter lampCommander test2: $(DEMO2) xfce4-terminal -e true $(foreach i,$(DEMO2),--tab -e "$(SHELL) -c \"LD_LIBRARY_PATH+=:. ./$(i) -a 224.0.29.200 -p 1236 -s my_secret\"" -T $(i)) Makefile.dep: $(DEMOS:=.c) $(CC) $(CFLAGS) -MM $^ > $@ include Makefile.dep .PHONY: all clean proper install test test2 svnignore .svnignore: echo $(DEMOS) $(DEMOS:=.o) | tr ' ' '\012' > $@ svnignore: .svnignore svn propset svn:ignore -F $< .