# Makefile # # Author: Carol Anne Oxborrow, DSRI Copenhagen. # oxborrow@dsri.dk # # Version: 1.0 # # Date: 18/2/1999 # # Function: To perform compilation and library building for # JEMX ISSW executables that use ISDC libraries, # common, dal, ril, pil and also cfitsio # Change Log: # 1999/02/18 First release corresponds to first installation of # ISDC libraries on tenma disk t. # # Name of your executable: PROGRAM_NAME = JGainFitting # Current version of executable being compiled: PROGRAM_VERSION = 0.1 # Name and version of individual function being compiled for library: # (Used in `make function' only) FUNCTION_NAME = JCalibRowSwap FUNCTION_VERSION = 0.5 # Directory containing your own /lib and /include directories, which contain # your personal headers and library (libJExecutable.a). These are the # defaults if you are working on the DSRI system ISSW_DIR = /t/jemx/isdc/issw # Directory contain the installation of the ISDC libraries and headers: # Do not change this if you're running of the DSRI system ISDC_DIR = /t/jemx/isdc # Directory naming conventions used on the DSRI system: LIBRARY = lib INCLUDE = include RANLIB = ranlib RM = /bin/rm # Put all your function file names here (not executables) SOURCE_FILES = JCalibChiSq0.5.c \ JCalibGuess0.5.c \ JCalibLMIteration0.5.c \ JCalibMakeMatrix0.5.c \ JCalibMatrixSolve0.5.c \ JCalibModel0.5.c \ JCalibMonteCarlo0.4.c \ JCalibResiduals0.5.c \ JCalibRowSwap0.5.c # Put all the names of the respectives function object files here OBJECT_FILES = JCalibChiSq0.5.o \ JCalibGuess0.5.o \ JCalibLMIteration0.5.o \ JCalibMakeMatrix0.5.o \ JCalibMatrixSolve0.5.o \ JCalibModel0.5.o \ JCalibMonteCarlo0.4.o \ JCalibResiduals0.5.o \ JCalibRowSwap0.5.o # This target recompiles your current executable and links it to the ISDC libraries # and the executable's own library and header. The compiled program is then run. executable: ${PROGRAM_NAME}${PROGRAM_VERSION}.c ${PROGRAM_NAME}.h ${PROGRAM_NAME}.a gcc -O2 -Wall -W -pedantic -Winline -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wshadow -Wstrict-prototypes \ -I${ISDC_DIR}/${INCLUDE} -I${ISSW_DIR}/${INCLUDE} ${PROGRAM_NAME}${PROGRAM_VERSION}.c \ -L${ISDC_DIR}/${LIBRARY} -L${ISSW_DIR}/${LIBRARY} -lsocket -lnsl -lm -ldal -lpil -lcommon -lril -lcfitsio -l${PROGRAM_NAME} mv a.out ${PROGRAM_NAME} chmod +x ${PROGRAM_NAME} ${PROGRAM_NAME} # This target takes a single function for the executable, compiles it and adds #it to (or replaces it in) the executable's library. function: ${FUNCTION_NAME}${FUNCTION_VERSION}.c gcc -c -O2 -Wall -W -pedantic -Winline -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wshadow -Wstrict-prototypes -I${ISDC_DIR}/${INCLUDE} -I${ISSW_DIR}/${INCLUDE} ${FUNCTION_NAME}${FUNCTION_VERSION}.c ar -r ${PROGRAM_NAME}.a ${FUNCTION_NAME}${FUNCTION_VERSION}.o ${RANLIB} ${PROGRAM_NAME}.a ar -t ${PROGRAM_NAME}.a cp ${PROGRAM_NAME}.a ${ISSW_DIR}/${LIBRARY}/lib${PROGRAM_NAME}.a echo Updated version of library installed in ${ISSW_DIR}/${LIBRARY} # This target compiles individual function object code without adding it to # a library object-files: gcc -c -O2 -Wall -W -pedantic -Winline -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wshadow -Wstrict-prototypes -I${ISDC_DIR}/${INCLUDE} -I${ISSW_DIR}/${INCLUDE} ${SOURCE_FILES} # This target makes an all-new version of the executable's library, moving the # previous version to .a.old library: gcc -c -O2 -Wall -W -pedantic -Winline -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wshadow -Wstrict-prototypes -I${ISDC_DIR}/${INCLUDE} -I${ISSW_DIR}/${INCLUDE} ${SOURCE_FILES} ar -r ${PROGRAM_NAME}.a ${OBJECT_FILES} ${RANLIB} ${PROGRAM_NAME}.a ar -t ${PROGRAM_NAME}.a cp ${PROGRAM_NAME}.a ${ISSW_DIR}/${LIBRARY}/lib${PROGRAM_NAME}.a echo All-new version of library installed in ${ISSW_DIR}/${LIBRARY} clean: rm *.o