# Makefile # # Author: Carol Anne Oxborrow, DSRI Copenhagen. # oxborrow@dsri.dk # # Version: 3.0 # # Date: 25/02/2000 # # Function: To perform compilation and library building for # JEMX ISSW executables that use ISDC libraries, # common, dal, ril, pil, cfitsio, dal3, slac etc. # This version uses the SUN cc compiler, which should # be used to test all ISDC deliverables before delivery. # It does not have all the warning flags that the gcc # version has, ans so is not recommended for developement. # Change Log: # 18/02/1999 First release corresponds to first installation of # ISDC libraries on tenma disk t. # 30/11/1999 Installation of Reference Platform 1.3 on DSRI system # 25/02/2000 Installation of Reference Platform 1.4 on DSRI system # Name of your executable: PROGRAM_NAME = jgainfitting EXECUTABLE_NAME = jgainfitting # Name and version of individual function being compiled for library: # (Used in `make function' only) FUNCTION_NAME = jcaliblmiteration # 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/isdc1_3 # 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 = jcalibchisq.c \ jcaliblmiteration.c \ jcalibguess.c \ jcalibmakematrix.c \ jcalibmatrixsolve.c \ jcalibmodel.c \ jcalibmontecarlo.c \ jcalibresiduals.c \ jcalibrowswap.c \ jgainfitting_work.c \ jgainfittingparams.c # Put all the names of the respectives function object files here OBJECT_FILES = jcalibchisq.o \ jcaliblmiteration.o \ jcalibguess.o \ jcalibmakematrix.o \ jcalibmatrixsolve.o \ jcalibmodel.o \ jcalibmontecarlo.o \ jcalibresiduals.o \ jcalibrowswap.o \ jgainfitting_work.o \ jgainfittingparams.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}_main.c ${PROGRAM_NAME}.h cp ${PROGRAM_NAME}.h ${ISSW_DIR}/${INCLUDE} cc -I${ISDC_DIR}/${INCLUDE} -I${ISSW_DIR}/${INCLUDE} ${PROGRAM_NAME}_main.c \ -L${ISDC_DIR}/${LIBRARY} -L${ISSW_DIR}/${LIBRARY} -lsocket -l${PROGRAM_NAME} -lnsl -ldal3jemx -ldal3cat -ldal3hk -ldal3aux -ldal3gen -lsla_c -lm -ldal -lpil -lcommon -lril -lcfitsio mv a.out ${EXECUTABLE_NAME} chmod +x ${EXECUTABLE_NAME} ${EXECUTABLE_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 cp ${PROGRAM_NAME}.h ${ISSW_DIR}/${INCLUDE} cc -c -I${ISDC_DIR}/${INCLUDE} -I${ISSW_DIR}/${INCLUDE} ${FUNCTION_NAME}.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: cp ${PROGRAM_NAME}.h ${ISSW_DIR}/${INCLUDE} cc -c -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: cp ${PROGRAM_NAME}.h ${ISSW_DIR}/${INCLUDE} cc -c -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 clean-libraries: rm ${ISSW_DIR}/${LIBRARY}/lib${PROGRAM_NAME}.a rm ${PROGRAM_NAME}.a