# Makefile for the file conversion utility # Peter Webb, Summer 1990 # Modified by Xinjian , Spring 1995 # # This file must be modified in order to build the distribution properly. # In particular, the parameters that specify the operating system and the # location of HDF and X (if X is installed) must be changed to conform to your # local configuration. # # Type 'make withoutx' for the version that does not use the X window system. # Type 'make withx' if you want a X-based graphical user interface. SHELL=/bin/sh # your C compiler(and options) CC = gcc -ansi # use this if you're using 'cc' on a DEC Alpha (OSF/1) or MIPS (Ultrix) system: # CC = cc -std1 -Olimit 750 # The operating system. Set this as appropriate for your machine. Only one # of these should be set at any given time. OS = BSD4 # Berkelely Unix (SUNs, Ultrix, etc) #OS = SYSV # System V Unix (Motorola, AT&T) #OS = UNICOS # Cray Unicos # Particular machines. Only one should be set at a time. MACHINE = -DSUN -Dsun #MACHINE = -DDEC #MACHINE = -DIRIS4 # Location of the pbmplus routines on your system - this can be blank, if # you don't have pbmplus. In fact, pbmplus is NOT necessary for running # either version of reformat, but may be used in future releases. pbmplus is # distributed on the X tape from MIT. PBM = # PBM = /stg3/pbmplus # No change needed here. #DEFS = $(MACHINE) DEFS = -D$(OS) -DPBM=\"$(PBM)\" $(X) $(MACHINE) # Locations of the HDF include files and the object library. Must be changed # as appropriate for your system. HDFINC = /hdf2/install/sun/include HDFLIB = /hdf2/install/sun/lib #Locations of the FITIO include files and the object library. Must be changed # as appropriate for your system. FITSINC=/hdf4/users/xlu/FITS4.08/include FITSLIB=/hdf4/users/xlu/FITS4.08/lib/sun # Locations of the TIFF include files and the object library. Must be changed # as appropriate for your system. TIFFINC = /hdf/home/xlu/tiff TIFFLIB = /hdf/home/xlu/tiff #if you haven't the TIFF library on your machine, do the following lines #define MakeTiffLib TIFF = -DDOTIFF TIFFDIR = /hdf/home/xlu/tiff TIFFINC = $(TIFFDIR) TIFFLIB = $(TIFFDIR)/libtiff.a $(TIFFLIB): #if defined(MakeTiffLib) ( cd $(TIFFDIR) ; make CC='$(CC)' ) #endif # If you are using X, this must be set to the top of the X source tree. #If your X11 include files and libs(libX11.a) aren't in the 'standard' places #where the C compiler can find, you can use CCOPTS line to tell the compiler #where the X11 include files and library files are. XINC = /usr/include/X11 XLIB = /usr/lib CCOPTS = -I$(XINC) -L$(XLIB) # F77LFLAGS is a platform-specific environment variable which specifies # the Fortran 77 libraries that need to be linked with the program. # More details about CFITSIO can be found at: # http://heasarc.gsfc.nasa.gov/docs/software/fitsio/cfitsio.html F77HOME=/bert/lang-sun4/SC1.0 F77LFLAG=-L$(F77HOME) -lF77 -lm # Flags passed to the C compiler. Leave these alone. CFLAGS = $(DEFS) -DDEBUG -I. -I$(XINC) -I$(HDFINC) -I$(TIFFINC) -I$(FITSINC) # Used in the command-line interface version. OFILES = cmdline.o error.o utils.o reformat.o convert.o hdfgifwr.o \ usage.o scandir.o tiff2ri8.o write_hdf.o\ write_tiff.o write_gif.o write_fits.o append_type.o debug.o\ gif2ri8.o strsave.o xwd2ri8.o write_xwd.o write_sunrst.o\ write_raw8.o raw8tori8.o sun2ri8.o \ hdf2raw8.o hdf2ras.o hdf2gif.o hdf2tiff.o hdf2xwd.o\ phdu2sds.o sdsutils.o fits2sds.o sds2phdu.o sds2fits.o # Support for the X graphical user interface. XFILES = window.o callback.o init_widgets.o confirm.o XOFILES = $(OFILES) $(XFILES) tiff2ri8.o : tiff2ri8.h window.o : window.h options.h init_widgets.o : window.h callback.o : window.h $(XOFILES) : error.h extern.h types.h reformat.h $(CHECK) # Be sure to add -lbsd if compiling in a SYSV environment LIBS = $(HDFLIB)/libnetcdf.a $(HDFLIB)/libdf.a $(HDFLIB)/libjpeg.a $(FITSLIB)/libfitsio.a $(TIFFLIB) -lm -lX11 #XLIBS = $(HDFLIB)/libdf.a $(TIFFLIB)/libtiff.a $(XLIB)/libXaw.a $(XLIB)/libXmu.a $(XLIB)/libXext.a $(XLIB)/libXt.a $(XLIB)/libX11.a -lm -lXm XLIBS = $(HDFLIB)/libnetcdf.a $(HDFLIB)/libdf.a $(HDFLIB)/libjpeg.a $(FITSLIB)/libfitsio.a $(TIFFLIB) $(XLIB)/libXaw.a $(XLIB)/libXmu.a $(XLIB)/libXext.a $(XLIB)/libXt.a $(XLIB)/libX11.a -lm -lXm # Flags for use with lint LINTFLAGS = -ac -I$(HDFINC) -I$(TIFFINC) $(DEFS) # all: $(TIFFLIB) withoutx withx withx: $(TIFFLIB) makeXreformat makeXreformat: if test -f reformat -a -f xreformat; then \ find reformat -newer xreformat -exec make clean ';' ; \ else if test -f reformat ; then \ make clean ; \ fi \ fi $(MAKE) "X = -DXGUI" xreformat ; withoutx: $(TIFFLIB) makeReformat makeReformat: if test -f xreformat -a -f reformat ; then \ find xreformat -newer reformat -exec make clean ';' ; \ else if test -f xreformat ; then \ make clean ; \ fi \ fi $(MAKE) reformat ; syntax: $(OFILES:.o=.ln) reformat : $(OFILES) $(CC) $(CFLAGS) -o $@ $(OFILES) $(LIBS) $(F77LFLAG) xreformat : $(XOFILES) $(CC) $(CFLAGS) -o $@ $(XOFILES) $(XLIBS) $(F77LFLAG) delint: rm -f $(OFILES:.o=.ln) clean: reformatclean tiffclean tiffclean: #if defined(MakeTiffLib) ( cd $(TIFFDIR); rm -f *.o *.bak) #endif reformatclean: rm -f $(XOFILES) $(OFILES:.o=.ln)