SHELL = /bin/sh AR=ar MV=mv INCMAIN =../include INCAUX =../include/aux INC =-I${INCMAIN} -I${INCAUX} GRAPEROOT = ../.. SRCDIR =. LIBDIR :=../lib LIB=-L${LIBDIR} -lgrape -laux -lm //AROPTS=cvr AROPTS=cr export CCOPTS MAKE xLEAKTEST=../LeakTracer/LeakTracer.o LEAKTEST= GRAPELIB := cycle_all.C atom_buildup.C residue.C \ jd_err_eval.C jd_rand_eval.C \ jd_occ_count.C atom_registry.C envelope.C \ atom_constraint.C distance_constraint.C \ bin_envelope_constraint.C gw_relax_atom.C \ constraint.C jd_anim_frame.C process.C \ constraint_manager.C jd_iterator.C molecule.C \ constraint_registry.C gw_numerics.C \ jd_stop_eval.C position_constraint.C \ jd_relax_subset.C envelope_constraint.C globals.C retired := gw_cycle_atoms.C # not used GRAPEAPP := grape.C ocount.C err_eval.C rand_eval.C GRAPESRC := ${GRAPELIB} ${GRAPEAPP} GRAPEOBJ := $(GRAPESRC:.C=.o) GRAPEDEP := $(GRAPESRC:.C=.d) install_libgrape: $(GRAPEOBJ) @tcsh -fc "echo '\033\[1;32mARCHIVING \033\[1;36m libgrape.a \033\[0;0m'" @${AR} ${AROPTS} libgrape.a $(GRAPEOBJ) ranlib libgrape.a ${MV} libgrape.a ${LIBDIR} ${LIBDIR}/libaux: (cd ${LIBDIR}; ${MAKE} libaux) ${LIBDIR}/libgrape: (cd ${LIBDIR}; ${MAKE} libgrape) grape: ../lib/libaux ../lib/libgrape grape.o @tcsh -fc "echo '\033\[1;31mCOMPILING \033\[1;36m $@ \033\[0;0m'" ${CC} -o grape grape.o ${CCOPTS} ${INC} ${LIB} ${LEAKTEST} occ: ../lib/libaux ../lib/libgrape ocount.o @tcsh -fc "echo '\033\[1;31mCOMPILING \033\[1;36m $@ \033\[0;0m'" ${CC} -o ocount ocount.o ${CCOPTS} ${INC} ${LIB} ${LEAKTEST} err_eval: ../lib/libaux ../lib/libgrape err_eval.o @tcsh -fc "echo '\033\[1;31mCOMPILING \033\[1;36m $@ \033\[0;0m'" ${CC} -o err_eval err_eval.o ${CCOPTS} ${INC} ${LIB} ${LEAKTEST} rand_eval: ../lib/libaux ../lib/libgrape rand_eval.o @tcsh -fc "echo '\033\[1;31mCOMPILING \033\[1;36m $@ \033\[0;0m'" ${CC} -o rand_eval rand_eval.o ${CCOPTS} ${INC} ${LIB} ${LEAKTEST} # dependancy files $(GRAPEDEP): %.d : %.C @tcsh -fc "echo '\033\[1;33mANALYZING \033\[1;36m $@ \033\[0;0m'" $(SHELL) -ec '$(CC) -MM $(CCOPTS) ${INC} $< | sed "s/\($*\)\.o[ :]*/\1.o $@ : /g" > $@' # this step reading in the .d files into this makefile -include $(GRAPEDEP) $(GRAPEOBJ): %.o: %.C %.d @tcsh -fc "echo '\033\[1;31mCOMPILING \033\[1;36m $@ \033\[0;0m'" $(CC) -c $(CCOPTS) ${INC} $< -o $@ # # ## TEST drivers ## # dist: dist.C g++ -o dist dist.C \ ${CCOPTS} ${INC} ${LIB} env: env-test.C g++ -o env env-test.C \ ${CCOPTS} ${INC} ${LIB} mol: mol-tst.C randomgenerator.C g++ -o mol mol-tst.C randomgenerator.C \ ${CCOPTS} ${INC} ${LIB} molio: molio.C g++ -o molio molio.C \ ${CCOPTS} ${INC} ${LIB} qs: qs-tst.C g++ -o qs qs-tst.C \ ${CCOPTS} ${INC} ${LIB} env_diff: env_diff.C g++ -o env_diff env_diff.C \ ${CCOPTS} ${INC} ${LIB} fresh: rm -f core *.o new: rm -f core grape molio qs segtest segtest2 cycletest moltest mol clean: rm -f core *.o lib*.a @echo "source objects removed" mrproper: rm -f core *.d *.o lib*.a @echo "source objects and all dependancies removed" # some common "special" variables (some of which get used in this makefile). # # $@ -- the target # $< -- the first dependancy # $^ -- all dependancies # $* -- the "stem"... the part that would match the "%" in a default rule. # # these can all be followed by a "D" or a "F" to get just the # directory or the file part respectivly. To get just the path # the target, but not the file name itself for example, use: # $(@D). Similarly use $(@F) for just the file name. # #g++ -o ENVDUMP -I../include -I../include/aux Env-test.C -lgrape -laux -L../lib