From ea28b7a78c19bd4e39d80cb53efafffc1ede388b Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Fri, 31 May 2013 09:34:41 +1000 Subject: [PATCH] add code to create, clean and ignore *.d files --- .gitignore | 1 + site_ansto/Makefile | 5 ++++- site_ansto/hardsup/makefile | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 008cd363..14163b07 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,5 @@ CVSPSI *.hdf5 *.a *.o +*.d *.out diff --git a/site_ansto/Makefile b/site_ansto/Makefile index d77b10e2..fda09faf 100644 --- a/site_ansto/Makefile +++ b/site_ansto/Makefile @@ -14,7 +14,7 @@ default: all # PSI rules and variables EXTRA=nintf.o -PSI_CLEAN_MATRIX = rm -f ../*.o ../psi/*.o; $(MAKE) -C ../matrix $(MFLAGS) clean +PSI_CLEAN_MATRIX = rm -f ../*.o ../*.d ../psi/*.o ../psi/*.d; $(MAKE) -C ../matrix $(MFLAGS) clean PSI_CFLAGS = -I./ $(INC_HDF5) $(INC_TCL8) -DDO_NOT_SELECT_BEFORE_SEND -DHDF5 -DNXXML\ -DCYGNUS -DNONINTF -std=gnu99 -g $(DFORTIFY)\ -Wall -Wextra -Wno-unused @@ -22,6 +22,7 @@ PSI_SLIBS = matrix/libmatrix.a PSI_LIBS = \ $(LIB_TCL8) $(LIB_HDF5) -lpthread \ -ldl -lz -lm -lc $(LIB_MXML) $(LIB_JSON) +PSI_CFLAGS += -MMD PSI_CFLAGS += -DSITE_ANSTO=1 ../%.o : ../%.c @@ -119,6 +120,7 @@ DEBUGFLAGS = -Wall -Wextra -Wno-unused -Wno-comment -Wno-switch CFLAGS = -g -std=gnu99 CFLAGS += $(INCFLAGS) CFLAGS += $(DEBUGFLAGS) +CFLAGS += -MMD CFLAGS += -DSICS_SITE='"${SICS_SITE}"' CFLAGS += -DSICS_VERSION='"${SICS_VERSION}"' CFLAGS += -DSICS_REVISION='"${SICS_REVISION}"' @@ -224,6 +226,7 @@ anstoclean: rm -f SICServer rm -f *.a rm -f *.o + rm -f *.d clean: anstoclean $(PSI_CLEAN_MATRIX) diff --git a/site_ansto/hardsup/makefile b/site_ansto/hardsup/makefile index 33b8c0b4..e70f19a2 100644 --- a/site_ansto/hardsup/makefile +++ b/site_ansto/hardsup/makefile @@ -8,7 +8,7 @@ SRC = . CC = gcc -CFLAGS = -g -std=gnu99 -DLINUX $(DFORTIFY) -I$(SRC) -I../.. $(INC_TCL8) -Wall -Wno-unused -Wextra +CFLAGS = -g -std=gnu99 -DLINUX $(DFORTIFY) -I$(SRC) -I../.. $(INC_TCL8) -Wall -Wno-unused -Wextra -MMD HOBJ = nhq200util.o HOBJ += itc4util.o @@ -39,4 +39,4 @@ libhlib.a: $(HOBJ) ranlib libhlib.a clean: - rm -f *.o *.a + rm -f *.o *.d *.a