# this is # ---------------------------------------------------------------------------- # # Copyright (c) 2010 by Thomas Forbriger (BFO Schiltach) # # a common Makefile for Erhards code # # REVISIONS and CHANGES # 01/11/2010 V1.0 Thomas Forbriger # 30/11/2010 V1.1 provide all targets; use calexew additionally, since # calex conflicts with SFF version of calex # 07/08/2012 V1.2 damb: added calex12 from EW # 19/09/2012 V1.3 thof: vendor import of recent calex version # 15/09/2016 V1.4 thof: install shell scripts and awk scripts # # ============================================================================ # # programs will be installed in $LOCBINDIR # shell scripts will be installed in $LOCSCRIPTDIR PROGRAMS=seife/seife calex/calex calex/calex10 calex/trical calex/qcalex \ sleeman/bandnois sleeman/tri2db sleeman/tricrosp sleeman/twocrosp \ dispcal/dispcal tiltcal/tiltcal SCRIPTS=winplot/winplot.sh \ sleeman/tricrosp.sh \ calex/calexiterextract.awk \ calex/calexoutextract.awk \ calex/calex.sh \ sleeman/tridb2table.awk \ sleeman/bandnois2table.awk \ sleeman/tricrosp2table.awk #---------------------------------------------------------------------- # check mandatory environment variable settings # --------------------------------------------- CHECKVAR=$(if $($(1)),,$(error ERROR: missing variable $(1))) CHECKVARS=$(foreach var,$(1),$(call CHECKVAR,$(var))) $(call CHECKVARS,LOCBINDIR LOCSCRIPTDIR) # ---------------------------------------------------------------------- # .PHONY: all all: install .PHONY: install install: $(addprefix $(LOCBINDIR)/,$(PROGRAMS)) \ $(addprefix $(LOCSCRIPTDIR)/,$(SCRIPTS)) $(LOCBINDIR)/%: % mkdir -pv $(LOCBINDIR) /bin/mv -fv $< $(LOCBINDIR) $(LOCSCRIPTDIR)/%: % mkdir -pv $(LOCSCRIPTDIR) /bin/cp -fv $< $(LOCSCRIPTDIR) # ---------------------------------------------------------------------- # FLAGS += $(MYFLAGS) FFLAGS += -ff2c -Wall -ffixed-line-length-0 -fno-backslash $(FLAGS) CFLAGS += $(FLAGS) CXXFLAGS+=-Wall $(FLAGS) LDFLAGS+=-L$(LOCLIBDIR) CPPFLAGS+=-I$(LOCINCLUDEDIR) $(FLAGS) #---------------------------------------------------------------------- flist: Makefile $(wildcard */*.f */*.par) echo $^ | tr ' ' '\n' | sort > $@ .PHONY: edit edit: flist; vim $< .PHONY: clean clean: ; -find . -name \*.bak | xargs --no-run-if-empty /bin/rm -v -/bin/rm -vf flist */*.o #---------------------------------------------------------------------- # single source file programs # --------------------------- dispcal/dispcal tiltcal/tiltcal \ sleeman/bandnois sleeman/tri2db sleeman/tricrosp sleeman/twocrosp \ seife/makeseifehelp calex/makecalexhelp: %: %.o $(FC) -o $@ $< # ---------------------------------------------------------------------- # seife # ----- seife/seife: seife/seife.o seife/seifeinfo.o $(FC) -o $@ $^ /bin/rm -fv seife/seifeinfo.* seife/seifeinfo.f: seife/makeseifehelp seife/seife.f /bin/rm -fv $@ cd seife; ./makeseifehelp # ---------------------------------------------------------------------- # calex # ----- calex/calex: calex/calex.o calex/calexinfo.o $(FC) -o $@ $^ calex/calex10: calex/calex10.o calex/calexinfo.o $(FC) -o $@ $^ calex/qcalex: calex/qcalex.o $(FC) -o $@ $^ calex/trical: calex/trical.o $(FC) -o $@ $^ calex/calexinfo.f: calex/makecalexhelp calex/calex.f \ calex/calex.par calex/calex-pz.par /bin/rm -fv $@ cd calex; ./makecalexhelp # ----- END OF Makefile -----