# # install directory PREFIX = /usr/local # PREFIX = /usr/local/sdf-0.67 # object files SDF_OBJECTS = sdf_subs.o # C compiler (required) - uncomment the one you want # COMPILER = gcc COMPILER = gcc # COMPILER = gcc4 # COMPILER = /opt/intel_cc_80/bin/icc # COMPILER = cc # Fortran 77 compiler (optional) - uncomment the one you want # F77 = g77 # F77 = g77 F77 = g77 # F77 = g95 # F77 = gfortran # F77 = ifort # F77 = f77 # F77 = lf95 # F77 = pgf77 # F77 = pgf90 # Fortran 90/95 compiler (optional) - uncomment the one you want # F95 = g95 # F95 = gfortran F95 = gfortran # F95 = ifort # F95 = lf95 # F95 = pgf90 # F95 = f90 # # Flags for the C compiler: # make sure flags set for large file support # UNCOMMENT ONE OF THESE SET OF COMPILER FLAGS OPTIONS # debug version of flags, with profile support #FLAGS = -g -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -I. -pg # debug version of flags, without profile support #FLAGS = -g -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -I. # un-optimized, non-debug (default options) version of flags, with profiling #FLAGS = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -I. -pg # un-optimized, non-debug (default options) version of flags, no profiling #FLAGS = -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -I. # optimized version of flags, with profile support #FLAGS = -O3 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -I. -pg # optimized version of flags, without profile support #FLAGS = -O3 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -I. FLAGS = -O3 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -I. # optimized version of flags, including -fomit-frame-pointer # FLAGS = -fomit-frame-pointer -O3 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -I. # optimized flags for SUN cc compiler, without profile support #FLAGS = -O -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE -I. # Flags for Fortran Compilers: Pick one and uncomment it. # Flags for optimization, no profiling # FFLAGS = -O3 -L. -lsdf FFLAGS = -O3 -L. -lsdf # Flags for optimization, and profiling # FFLAGS = -O3 -L. -lsdf -pg # Flags for debugging, no profiling # FFLAGS = -g -L. -lsdf # Flags for debugging, and profiling # FFLAGS = -g -L. -lsdf -pg # Flags for default options, no profiling # FFLAGS = -L. -lsdf # Flags for default options, and profiling # FFLAGS = -L. -lsdf -pg # NOTE - if you pick a version with profiling, you might need to add -lgprof # to -lsdf (in MINGW, for example) sdf_browse : sdf_browse.c libsdf.a echo "compiling sdf_browse" $(COMPILER) $(FLAGS) sdf_browse.c -L. -lsdf -o sdf_browse libsdf.a : sdf_subs.o echo "making library archive" $@ ar -rs libsdf.a $(SDF_OBJECTS) sdf_subs.o : sdf_subs.c sdf_subs.h echo "compiling sdf_subs.o" $@ $(COMPILER) $(FLAGS) -c sdf_subs.c my_C_prog: libsdf.a my_C_prog.c sdf_subs.h echo "compiling my_C_prog" $@ $(COMPILER) $(FLAGS) my_C_prog.c -I. -L. -lsdf -o my_C_prog # make sdf.dll works in WINDOZE only: sdf.dll: sdf_subs.c sdf_subs.h echo "compiling sdf.dll" $@ $(COMPILER) $(FLAGS) -shared -o sdf.dll sdf_subs.c -Wl,--output-def,sdf.def,--out-implib,sdf_imp_subs.lib echo "creating zip file with sdf.dll, sdf.def" zip sdf_dll sdf.def sdf.dll xtestmain: libsdf.a main_test_sdf.c sdf_subs.h echo "compiling xtestmain" $@ $(COMPILER) $(FLAGS) main_test_sdf.c -I. -L. -lsdf -o xtestmain xtest_sdf_edit: libsdf.a sdf_test_edit.c sdf_subs.h echo "compiling xtest_sdf_edit" $@ $(COMPILER) $(FLAGS) sdf_test_edit.c -I. -L. -lsdf -lm -o xtest_sdf_edit xlarge: libsdf.a test_sdf_large.c sdf_subs.h echo "compiling xlarge" $@ $(COMPILER) $(FLAGS) test_sdf_large.c -I. -L. -lsdf -lm -o xlarge x3d: libsdf.a test_sdf_3d.c sdf_subs.h echo "compiling x3d" $@ $(COMPILER) $(FLAGS) test_sdf_3d.c -I. -L. -lsdf -lm -o x3d x4d: libsdf.a test_sdf_4d.c sdf_subs.h echo "compiling x4d" $@ $(COMPILER) $(FLAGS) test_sdf_4d.c -I. -L. -lsdf -lm -o x4d x5d: libsdf.a test_sdf_5d.c sdf_subs.h echo "compiling x4d" $@ $(COMPILER) $(FLAGS) test_sdf_5d.c -I. -L. -lsdf -lm -o x5d xtc89: libsdf.a test_complex_c89.c sdf_subs.h echo "compiling xtc89" $@ $(COMPILER) $(FLAGS) test_complex_c89.c -I. -L. -lsdf -lm -o xtc89 xtc99: libsdf.a test_complex_c99.c sdf_subs.h echo "compiling xtc99" $@ $(COMPILER) $(FLAGS) test_complex_c99.c -I. -L. -lsdf -lm -o xtc99 xtestf77: libsdf.a sdf_f77_tests.f echo "compiling xtestf77" $@ $(F77) sdf_f77_tests.f $(FFLAGS) -o xtestf77 xtestt: libsdf.a sdf_f77_testt.f echo "compiling xtestt" $@ $(F77) sdf_f77_testt.f $(FFLAGS) -o xtestt xtestrbwb: libsdf.a test_rbwb.f echo "compiling xtestrbwb" $@ $(F77) test_rbwb.f $(FFLAGS) -o xtestrbwb xtestrbwb: libsdf.a test_rbwb.f echo "compiling xtestrbwb" $@ $(F77) test_rbwb.f $(FFLAGS) -o xtestrbwb xtp: libsdf.a test_prim.f echo "compiling xtp" $@ $(F77) test_prim.f $(FFLAGS) -o xtp xtest_dyn_f95: libsdf.a test_sdf_dynamic.F90 echo "compiling xtest_dyn_f95" $@ $(F95) test_sdf_dynamic.F90 $(FFLAGS) -o xtest_dyn_f95 xtest_transp_f95: libsdf.a test_sdf_transpose.F90 echo "compiling xtest_transp_f95" $@ $(F95) test_sdf_transpose.F90 $(FFLAGS) -o xtest_transp_f95 all: sdf_browse xtestmain xtestf77 xtest_dyn_f95 xtest_transp_f95 xtest_sdf_edit xlarge x3d x4d x5d xtc89 xtestt xtestrbwb xtp clean: rm -f *.o libsdf.a sdf_browse sdf_browse.exe xtestmain xtestmain.exe sdf.def sdf.dll sdf_imp_subs.lib xtestf77 xtestf77.exe xtest_transp_f95 xtest_transp_f95.exe xtest_dyn_f95 xtest_dyn_f95.exe xtest_sdf_edit xtest_sdf_edit.exe xlarge xlarge.exe x3d x3d.exe x4d x4d.exe x5d x5d.exe xtc89 xtc89.exe xtc99 xtc99.exe xtestt xtestt.exe xtestrbwb xtestrbwb.exe xtp xtp.exe install: mkdir -p $(PREFIX)/lib mkdir -p $(PREFIX)/include mkdir -p $(PREFIX)/bin cp ./libsdf.a $(PREFIX)/lib cp ./sdf_subs.h $(PREFIX)/include cp ./sdf_browse $(PREFIX)/bin uninstall: rm -f $(PREFIX)/lib/libsdf.a rm -f $(PREFIX)/include/sdf_subs.h rm -f $(PREFIX)/bin/sdf_browse