From 11e0d1618a5f347e3416908088f800013c536bb5 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Mon, 25 Sep 2017 23:05:01 +0200 Subject: [PATCH] Simplify the Makefile and make it compatible with parallel invocation. --- example/Makefile | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/example/Makefile b/example/Makefile index 5d13faf5..6110176b 100644 --- a/example/Makefile +++ b/example/Makefile @@ -3,18 +3,16 @@ CFLAGS=-Wall -W -pedantic -Wshadow -Wpointer-arith -Wcast-qual -Wstrict-prototyp CPPFLAGS=-I.. LDFLAGS=-pthread -lgmp RM=rm -f -EXE=./a.exe + +.SUFFIXES: .c .exe + +.c.exe: + $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@ all: - @echo "Nothing to be done." - -check: examples - -examples: - for f in ex-*.c ; do $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -g $$f -o $(EXE) ; done + $(MAKE) `ls ex-*.c|sed -e 's/\.c/\.exe/g'` clean: - $(RM) $(EXE) *.s *~ *.o ./a.dat - $(RM) -r coverage *.gcda *.gcno all.info test.tar README.html + $(RM) *.exe *.s *~ *.o ./a.dat