Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
tuto-msg: use old-fashioned suffix rules in Makefile.
[simgrid.git] / doc / tuto-msg / Makefile
index 665ba9c..3ad9e06 100644 (file)
@@ -11,13 +11,12 @@ CC ?= gcc                     # Your compiler (on Mac, use clang instead)
 ############################################################################
 
 all: masterworker
-masterworker: masterworker.o
 
-WARNING = -Wshadow -Wcast-align -Waggregate-return -Wmissing-prototypes \
-          -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes \
-          -Wmissing-declarations -Wmissing-noreturn -Wredundant-decls \
-         -Wnested-externs -Wpointer-arith -Wwrite-strings
-WARNING += -Werror # Comment that line to not be in paranoid mode
+WARNINGS = -Wall -Wextra -Wshadow -Wcast-align -Waggregate-return -Wmissing-prototypes \
+          -Wmissing-declarations -Wmissing-prototypes -Wpointer-arith -Wwrite-strings \
+          -Wmissing-noreturn -Wredundant-decls \
+         -Wno-nested-externs  -Wno-strict-prototypes -Wno-unused-parameter
+WARNINGS += -Werror # Comment that line to not be in paranoid mode
 
 # CFLAGS = -std=gnu99 -g -O0 $(WARNINGS) $(EXTRA_CFLAGS) # Use this line to make debugging easier
 CFLAGS = -std=gnu99 -g -O2 $(WARNINGS) $(EXTRA_CFLAGS) # Use this line to get better performance
@@ -27,13 +26,10 @@ CFLAGS = -std=gnu99 -g -O2 $(WARNINGS) $(EXTRA_CFLAGS) # Use this line to get be
 # The following are implicit rules, used by default to actually build
 # the targets for which you listed the dependencies above.
 
+.SUFFIXES: .c
 # The blanks before the $(CC) must be a Tab char, not spaces
-%: %.o
-       $(CC) -L$(strip $(SIMGRID_INSTALL_PATH))/lib/    $(CFLAGS) $^ -lsimgrid -o $@
-%.o: %.c
-       $(CC) -I$(strip $(SIMGRID_INSTALL_PATH))/include $(CFLAGS) -c -o $@ $<
-%: %.c
-       $(CC) -I$(strip $(SIMGRID_INSTALL_PATH))/include -L$(strip $(SIMGRID_INSTALL_PATH))/lib/  $(CFLAGS) $^ -lsimgrid -o $@ 
+.c:
+       $(CC) -I$(strip $(SIMGRID_INSTALL_PATH))/include -L$(strip $(SIMGRID_INSTALL_PATH))/lib/ $(CFLAGS) $^ -lsimgrid -o $@
 
 clean:
        rm -f *.o *~ masterworker masterworker-sol1 masterworker-sol2 masterworker-sol3 masterworker-sol4