#++++++++++++++++ #.IDENTIFICATION makefile #.LANGUAGE Make (makefile script) #.AUTHOR Francois Ochsenbein [CDS] #.ENVIRONMENT Unix #.KEYWORDS #.VERSION 1.0 20-Oct-1994 #.VERSION 2.0 18-Jan-2003: Use autoconf #.PURPOSE (Re)Create dependent files in this Directory #.COMMENTS To generate on a new system use e.g. # ./configure -prefix=$HOME #---------------- # DEFINITIONS: #CC = cc #CC = cc -fwritable-strings AWK = @AWK@ CC = @CC@ @cc_opt@ COPY = cp -p STRIP = @STRIP@ RANLIB = @RANLIB@ AR = ar DEBUG = -O C_OPT = SYS = CFLAGS = $(C_OPT) $(DEBUG) $(SYS) -I. COMPILE= $(CC) $(CFLAGS) -c ############################################################## # Definitions specific to the installation ############################################################## # If OGLU not defined, default is /usr/local/bin/glufilter ##### CDS Installation (depends on architecture) # Directories: #PREFIX = /usr/local #PREFIX = $(HOME) PREFIX = @prefix@ PACKAGE = html VERSION = @version@ DISTRIB = $(PACKAGE)-$(VERSION) #LIBX11 = /usr/lib/X11 #LIBX11 = /usr/openwin/lib/X11 LIBX11 = @LIBX11@ INCDIR = $(PREFIX)/include LIBDIR = $(PREFIX)/lib BINDIR = $(PREFIX)/bin MANDIR = $(PREFIX)/man #OGLU = $(BINDIR)/glufilter OGLU = @OGLU@ ############################################################## #### Possible alternative: #OGLU = $(HOME)/glu/glufilter #LIBX11 = /usr/lib/X11 #LIBDIR = $(HOME)/lib #BINDIR = $(HOME)/bin #INCDIR = $(HOME)/include ############################################################## RGB = $(LIBX11)/rgb.txt PGM = cgiprint cgiparm cgigraph SRC = cgiprint.c cgiparm.c cgigraph.c INC = regexp.h cgitr.h LIB = rgb.txt cgiprint.o DOC = cgiprint_en.tex cgiprint_fr.tex html.tex VERFILE = $(PREFIX)/versions # DEPENDENCIES: default: $(PGM) cgiprint.lis cgiprint.o all: $(PGM) cgiprint.lis cgiprint.o: cgiprint.c Makefile $(CC) $(CFLAGS) -DOGLU='"$(OGLU)"' -DRGB='"$(RGB)"' -DFUNCTION -c $< cgiprint: cgiprint.c Makefile $(CC) $(CFLAGS) -DOGLU='"$(OGLU)"' -DRGB='"$(RGB)"' $@.c -o $@ $(STRIP) $@ cgiprint.lis: cgiprint echo 'List of recognised TeX Macros/Environment' > $@ echo '' >> $@ cgiprint -LIST | sort | grep '^[{\]' | gawk '\ /^{/{if (n==0) print ""; n++}{ print} ' >> $@ cgiparm: cgiparm.c $(CC) $(CFLAGS) $@.c -o $@ $(STRIP) $@ cgigraph: cgigraph.c $(CC) $(CFLAGS) $@.c -o $@ $(STRIP) $@ testcgitr: testcgitr.c cgiprint.o $(CC) $(CFLAGS) $@.c cgiprint.o -o $@ $(STRIP) $@ #@for f in $? ; do if file $$f | fgrep -s executable ; then \ #echo "----$$f seems OK"; else exit 1 ; fi ; done install: $(PGM) $(LIB) cgitr.h install_info test -d $(LIBDIR) || mkdir $(LIBDIR) test -d $(INCDIR) || mkdir $(INCDIR) test -d $(BINDIR) || mkdir $(BINDIR) $(COPY) $(LIB) $(LIBDIR) $(COPY) cgitr.h $(INCDIR) $(COPY) $(PGM) $(BINDIR) rm -rf *.cache install_info: touch $(VERFILE) (cat $(VERFILE); echo "$(PACKAGE):V$(VERSION)"; \ for f in $(PGM); do \ ./$$f -version | $(AWK) '{printf "-%s:%s\n", $$1, $$NF}'; done ) \ | $(AWK) -F: '{n++; P[n]=$$1; V[$$1]=$$2}END{for(i=1;i<=n;i++) { \ p=P[i]; v=V[p]; if(v!="") print p ":" v; V[p]="" }}' > version.tmp test -s version.tmp && cat version.tmp > $(VERFILE) \ && rm -f version.tmp clean: rm -f *.a *.o core a.out rm -f $(PGM) rm -rf *.cache # Generate an exportable package export: /tmp/$(DISTRIB).tar tar: /tmp/$(DISTRIB).tar /tmp/$(DISTRIB).tar: $(SRC) Makefile.in *.c $(MAKE) clean -test -d /tmp/$(DISTRIB) && rm -rf /tmp/$(DISTRIB) autoconf mkdir /tmp/$(DISTRIB) cp -p $(SRC) $(INC) $(MAN) $(DOC) rgb.txt /tmp/$(DISTRIB) cp -p Makefile.in configure /tmp/$(DISTRIB) cd /tmp && tar cf $@ $(DISTRIB) rm -rf /tmp/$(DISTRIB) gzip -v9 $@ .POSIX: .SILENT : cvs cvs: d=`echo $(PWD)|sed 's/^.*\///g'`; \ if test $$d = $(PACKAGE); then \ d=`cvs diff configure*|wc -l` ; \ if test $$d -eq 0; then \ v=`echo $(VERSION)|sed 's/\./_/g'` ; echo "version: V$$v"; \ cvs tag V$$v . ; \ else \ echo "****you must commit 'configure*' before" ; \ fi \ fi