SHELL = /bin/sh RM = rm -f MYOS := $(subst -,,$(shell uname)) C_EXE = ../$(MYOS)/bin/convert C_OBJ = convert.o \ db_replace.o print_me.o gen_name.o CB_EXE = ../$(MYOS)/bin/convertback CB_OBJ = convertback.o \ db_replace.o printer.o db_read_parse.o parse_name.o \ parse_initial.o parse_final.o ifeq ($(MYOS),SunOS) CERN_ROOT =/site/cernlib/sun4_solaris2/95a endif CERN_DIR = $(CERN_ROOT)/lib CERNLIBS = -L$(CERN_DIR) \ -lpawlib \ -lpacklib \ -lmathlib \ -lgraflib \ -lgrafX11 \ -lpacklib \ -lherwig \ -lkernlib \ -lphotos \ -lphtools MOTIF = /usr/lib/Motif1.2 MLIB = -L$(MOTIF) \ -lMrm \ -lXm X11LIBDIR = /usr/lib/X11R5 X11LIBS = -L$(X11LIBDIR)\ -lX11\ -lXt ifeq ($(MYOS),SunOS) FFLAGS=-e -O -C FC=f77 LIBS = -lc -lm -lnsl -lsocket -L/usr/lib -ldl endif ifeq ($(MYOS),Linux) FFLAGS= -s -W -N2 -N22 -N90 -B108 -f FC=f77 LIBS = -lc -lm -lnsl -L/usr/lib -lcrypt -ldl -L/apps/egcs/egcs-1.1.2/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.91.66/ -lg2c MLIB = -L/usr/X11R6/lib -lMrm -lXm -lXp -lXext CERNLIBS = -L$(CERN_DIR) -lpawlib -lmathlib -lpacklib \ -lmathlib \ -lgraflib \ -lgrafX11 \ -lpacklib endif all: $(C_EXE) $(CB_EXE) $(C_EXE): $(C_OBJ) ../$(MYOS)/bin $(FC) $(FFLAGS) -o $(C_EXE) $(C_OBJ) $(MLIB) $(CERNLIBS) $(X11LIBS) $(LIBS) $(CB_EXE): $(CB_OBJ) ../$(MYOS)/bin $(FC) $(FFLAGS) -o $(CB_EXE) $(CB_OBJ) $(MLIB) $(CERNLIBS) $(X11LIBS) $(LIBS) ../$(MYOS)/bin: mkdir ../$(MYOS) mkdir ../$(MYOS)/bin clean: $(RM) *.o $(C_EXE) $(CB_EXE) core #the rule below updates a file, Makefile.dep, that lists which include files #each fortran file uses. If an include file is changed, all the fortran files #that use it will automatically be recompiled. p.mckee dec03 Makefile.dep : *.inc @ echo "Updating dependencies on include files" @ echo -e "#specify include files used by each .f file\n" > Makefile.dep @ for file in `ls *.f | sed 's/\.f//'` ; do\ inc_files=`cat $$file.f | sed -n 's/^[[:blank:]]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][ ]*['\''"]\(.*\)['\''"]/\1/p' | sort | uniq | xargs echo -n` ;\ if [ -n "$$inc_files" ]; then \ echo "$$file.o : $$file.f $$inc_files" >> Makefile.dep;\ fi;\ done include Makefile.dep