# # Makefile to build sources that use the tsmApi library. You can customise # this file for your own platform and programs - just follow the comments # below. This Makefile has been written for compiling code with the # tsmApi 1.3 and DPSS 2.5.2 libraries. # # $Id: Makefile_generic,v 1.9 1999/05/20 20:34:23 reddy Exp $ # # usage: make [ | all | clean ] # # Author: Martin Reddy, # (c) SRI International 1999. All rights reserved. # # Specify the compiler to use, e.g. cc, gcc, cc -n32, etc. CC = cc # What are all of the source code files in this directory? If you include # foo.c in here, then you can compile this program with "make foo". SOURCES = \ simple.c \ get_tile.c \ get_tspec.c \ copy_dataset.c \ vtile.c \ tree.c \ image.c \ time_tiles.c \ checksum.c \ calc_stats.c \ database.c \ make_oi.c \ make_dem.c \ dem_to_pgm.c \ utm_conv.c # Now we need to specify the directories where we can find the tsmApi # and DPSS libs/includes. E.g. If you have installed the DPSS distribution # in /usr/local/DPSS (containing the subdirectories /usr/local/DPSS/lib and # /usr/local/DPSS/include), then DPSS_DIR=/usr/local/DPSS. Likewise for # the tsmApi. DPSS_DIR = /usr/local/DPSS TSMAPI_DIR = /usr/local/tsm # Which libraries do we want to link with. For the DPSS, these are different # for different architectures and different versions of the DPSS libraries. # Below are a list of some platform libs that have been set up for you - # just uncomment the one you want. You should really use V2.5 or greater. DPSS_LIBS = $(DPSS_252_LIBS_SOLARIS) #DPSS_LIBS = $(DPSS_252_LIBS_IRIX) #DPSS_LIBS = $(DPSS_252_LIBS_LINUX) #DPSS_LIBS = $(DPSS_252_LIBS_OSF) # Specify the compiler flags to use: CFLAGS used to compile and link, # CPPFLAGS only used for compile. You probably don't need to change this. CFLAGS = CPPFLAGS = -O -DHAVE_CONFIG_H -DDPSS -DTRACING # -------------------------------------------------------------------------- # -------------------> NOTHING TO CHANGE BELOW HERE <----------------------- # -------------------------------------------------------------------------- # State where all of the include file and libraries are. These are setup # so that they will find include/lib files in the tsmApi binary distribution # or the tsmApi source distribution: whichever the user has set TSMAPI_DIR to INCLUDES = -I$(TSMAPI_DIR)/include -I$(DPSS_DIR)/include -I/usr/local/include LIBDIRS = -L$(TSMAPI_DIR)/lib -L$(DPSS_DIR)/lib -L/usr/local/lib # Define the various DPSS lib set ups and also the libs that are needed # for tsmApi - these shouldn't need customising DPSS_252_LIBS = -ldpss -ldpssutils -ldpssLdap -ldb -ljnetutils -ldimage DPSS_252_LIBS_IRIX = $(DPSS_252_LIBS) DPSS_252_LIBS_SOLARIS = $(DPSS_252_LIBS) -lsocket -lnsl DPSS_252_LIBS_LINUX = $(DPSS_252_LIBS) DPSS_252_LIBS_OSF = $(DPSS_252_LIBS) TSM_LIBS = -ltsmApi-DPSS -lvrml2 -lpthrutil -ltiff -ljpeg -lungif -lz SYSTEM_LIBS = -lpthread -lm # Now a number of rules to compile the above source files OBJECTS = $(SOURCES:.c=.o) TARGETS = $(SOURCES:.c=) LIBS = $(TSM_LIBS) $(DPSS_LIBS) $(SYSTEM_LIBS) FLAGS = $(CFLAGS) $(CPPFLAGS) $(INCLUDES) RM = rm -f all: $(TARGETS) clean: $(RM) $(OBJECTS) $(TARGETS) core dist: all @ echo "Copying binaries to ./bin directory..." @ test -d bin || mkdir bin @ cp $(TARGETS) bin @ echo "Stripping all binaries in ./bin..." @ strip bin/* @ echo "Creating tsmUtils.tar..." @ tar cf tsmUtils.tar bin/* @ echo "Removing bin directory" @ rm -rf bin # finally, here are the explicit rules to make all of the # tsmUtils targets. simple: simple.c @ echo "Compiling $<" @ $(CC) $(FLAGS) simple.c $(LIBDIRS) $(LIBS) -o simple copy_dataset: copy_dataset.c @ echo "Compiling $<" @ $(CC) $(FLAGS) copy_dataset.c $(LIBDIRS) $(LIBS) -o copy_dataset image: image.c @ echo "Compiling $<" @ $(CC) $(FLAGS) image.c $(LIBDIRS) $(LIBS) -o image tree: tree.c @ echo "Compiling $<" @ $(CC) $(FLAGS) tree.c $(LIBDIRS) $(LIBS) -o tree vtile: vtile.c @ echo "Compiling $<" @ $(CC) $(FLAGS) vtile.c $(LIBDIRS) $(LIBS) -o vtile copy_tspec: copy_tspec.c @ echo "Compiling $<" @ $(CC) $(FLAGS) copy_tspec.c $(LIBDIRS) $(LIBS) -o copy_tspec get_tile: get_tile.c @ echo "Compiling $<" @ $(CC) $(FLAGS) get_tile.c $(LIBDIRS) $(LIBS) -o get_tile get_tspec: get_tspec.c @ echo "Compiling $<" @ $(CC) $(FLAGS) get_tspec.c $(LIBDIRS) $(LIBS) -o get_tspec get_http_tile: get_http_tile.c @ echo "Compiling $<" @ $(CC) $(FLAGS) get_http_tile.c $(LIBDIRS) $(LIBS) \ -I$(CGILIB_DIR) -L $(CGILIB_DIR) -lcgi -o get_http_tile @ echo "Stripping $<" @ strip get_http_tile time_tiles: time_tiles.c @ echo "Compiling $<" @ $(CC) $(FLAGS) time_tiles.c $(LIBDIRS) $(LIBS) -o time_tiles calc_stats: calc_stats.c @ echo "Compiling $<" @ $(CC) $(FLAGS) calc_stats.c $(LIBDIRS) $(LIBS) -o calc_stats database: database.c @ echo "Compiling $<" @ $(CC) $(FLAGS) database.c $(LIBDIRS) $(LIBS) -o database make_oi: make_oi.c @ echo "Compiling $<" @ $(CC) $(FLAGS) make_oi.c $(LIBDIRS) $(LIBS) -o make_oi make_dem: make_dem.c @ echo "Compiling $<" @ $(CC) $(FLAGS) make_dem.c $(LIBDIRS) $(LIBS) -o make_dem checksum: checksum.c @ echo "Compiling $<" @ $(CC) $(FLAGS) checksum.c $(LIBDIRS) $(LIBS) -o checksum utm_conv: utm_conv.c @ echo "Compiling $<" @ $(CC) $(FLAGS) utm_conv.c $(LIBDIRS) $(LIBS) -o utm_conv dem_to_pgm: dem_to_pgm.c @ echo "Compiling $<" @ $(CC) $(FLAGS) dem_to_pgm.c $(LIBDIRS) $(LIBS) -o dem_to_pgm # EOF: Makefile