############################################################################# # # # Makefile for gmake V1.0 This makefile will keep an archive library purely # # on the dates of the source files. The lines below are the ones you can # # change; LIB is the name of the library to make; SRC is the set of C files # # that comprise the library and DEP is the name of any dependency for all # # the sources. If you want files to have individual dependencies copy the # # line $(DEP) at the end of this Makefile and adjust as appropriate. # # # # P.J. Daly March 1992. # # # ############################################################################# LIB = /EXPG/lib/$(HNAME)/libesrf_data_format.a SRC = Error.c CloseFiles.c OpenFiles.c WriteData.c Support.c MatchKey.c \ GetValues.c ReadData.c ConvertData.c Display.c Tables.c Version.c \ CompressData.c Find.c Interrupt.c pack.c F77_int.c F77_alt.c DEP = esrf_data_format.h # # Search paths - `incpath' for include files `libpath' for libraries # INCPATH = /EXPG/include:../include:./compress LIBPATH = /EXPG/lib/$(HNAME):../lib # # Define the default C compiler # CC = gcc # # Define the default C compiler flags (machine specific ones are added later) # DEF_CC_FLAGS = -ansi -g $(patsubst %,-I%,$(subst :, ,$(INCPATH))) \ $(patsubst %,-L%,$(subst :, ,$(LIBPATH))) # # Define the default Fortran compiler # FC = f77 # # Define the default Fortran compiler flags # DEF_FC_FLAGS = -g # # Find out which host machine we are on # HOST = $(shell uname -s) # # Set the search path to use include and library paths # VPATH = $(LIBPATH):$(INCPATH) # # Define the defaults for HP not defined above # ifeq ($(word 1, $(HOST)), HP-UX) CFLAGS = $(DEF_CC_FLAGS) -Dhpux -D__hpux -DPWB -D_PWB -Dunix -D__unix FFLAGS = $(DEF_FC_FLAGS) FLIBS = -lcl -lc LINTFLAGS = -u -Aa $(patsubst %,-I%,$(subst :, ,$(INCPATH))) HNAME = hp700/ RANLIB = @echo no need for ranlib on endif # # Define the defaults for Sun not defined above # ifeq ($(word 1,$(HOST)), SunOS) SYSTEM = $(shell mach) CFLAGS = $(DEF_CC_FLAGS) -static -fno-builtin -Dsun -D$(SYSTEM) -Dunix FFLAGS = $(DEF_FC_FLAGS) FLIBS = -L/usr/lang/SC1.0 -lF77 -lV77 -lm -lc LINTFLAGS = -h -u -c -a $(patsubst %,-I%,$(subst :, ,$(INCPATH))) HNAME = sun4/ RANLIB = ranlib endif # # define targets that are internal to this Makefile # .PHONY: all env lint clean all: $(LIB) @echo "done" env: @echo "CC = $(CC)" @echo "CFLAGS = $(CFLAGS)" @echo "FC = $(FC)" @echo "FFLAGS = $(FFLAGS)" @echo "FLIBS = $(FLIBS)" @echo "HOST = $(HOST)" @echo "INCPATH = $(INCPATH)" @echo "LIBPATH = $(LIBPATH)" @echo "VPATH = $(VPATH)" @echo "HNAME = $(HNAME)" @echo "RANLIB = $(RANLIB)" lint: $(wildcard *.c) lint $(LINTFLAGS) $^ clean: rm -f core $(LIB) $(LIB): $(SRC) $(CC) $(OPTS) $(CFLAGS) -c $? ar r $@ $(patsubst %.c, %.o, $?) $(RANLIB) $@ rm -f $(patsubst %.c, %.o, $?) touch $@ $(SRC): $(DEP) touch $@