home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / FREEZE-2.ZIP / makefile < prev    next >
Makefile  |  1992-07-18  |  3KB  |  148 lines

  1. # SHELL         = /bin/sh
  2. # MAKEFILE      = makefile
  3.  
  4. default:
  5.     @echo ''
  6.     @echo 'Please indicate the system to make Freeze for.'
  7.     @echo 'Possible choices are: bsd, sysv, x286, sun4,'
  8.     @echo 'generic.'
  9.     @echo ''
  10.  
  11. DEST          = /usr/local/bin
  12. MANDEST       = /usr/local/man/man1
  13. SEC           = 1
  14.  
  15. HDRS          = bitio.h\
  16.         compat.h\
  17.         freeze.h\
  18.         huf.h\
  19.         lz.h\
  20.         patchlevel.h
  21.  
  22. CC            = gcc
  23. # or proprietary compiler, if it's better than that
  24.  
  25. OPTIONS       = -DCOMPAT
  26.  
  27. LINTFLAGS     = -DBITS=15 -DSIGTYPE=void -DCOMPAT -DDEBUG\
  28.         -DGATHER_STAT -x -DFAST
  29.  
  30. OBJS          = bitio.o\
  31.         debug.o\
  32.         decode.o\
  33.         default.o\
  34.         encode.o\
  35.         freeze.o\
  36.         huf.o\
  37.         lz.o
  38.  
  39. PROGRAM       = freeze
  40.  
  41. CATMAN        = freeze.man statist.man
  42.  
  43. MAN           = freeze.1 statist.1
  44.  
  45. SRCS          = bitio.c\
  46.         debug.c\
  47.         decode.c\
  48.         default.c\
  49.         encode.c\
  50.         freeze.c\
  51.         huf.c\
  52.         lz.c
  53.  
  54. .SUFFIXES:       .1 .man
  55.  
  56. .1.man:
  57.         nroff -man < $< > $@
  58.  
  59. .c.o:
  60.         $(CC) -c $(CFLAGS) $(OPTIONS) $<
  61.  
  62. prog:            $(PROGRAM)$(EXE) statist$(EXE)
  63.  
  64. man:            $(CATMAN)
  65.  
  66. lint:           $(SRCS)
  67.         lint $(LINTFLAGS) $(SRCS) > lint.out
  68.  
  69. $(PROGRAM)$(EXE): $(OBJS)
  70.         $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) -o $(PROGRAM)$(EXE)
  71.  
  72. statist$(EXE): statist.o lz.o
  73.         $(CC) $(CFLAGS) $(LDFLAGS) -o statist$(EXE) statist.o lz.o $(LIBS)
  74.  
  75. clobber:        clean
  76.         rm -f $(PROGRAM) statist *.man
  77.  
  78. clean:;         rm -f *.o *.b .,* core *.out
  79.  
  80. install:        $(DEST)/$(PROGRAM) $(DEST)/statist $(MANDEST)/freeze.$(SEC) $(MANDEST)/statist.$(SEC)
  81.  
  82. patch:;         rm -f patch.out
  83.         -for i in ../distribution/* ; do \
  84.         (diff -c $$i `basename $$i` >> patch.out); \
  85.         done
  86.  
  87. $(DEST)/$(PROGRAM): $(PROGRAM)
  88.         cp $(PROGRAM) $@
  89.         chmod 755 $@
  90.         -strip $@
  91.         -mcs -d $@
  92.         -ln -f $@ $(DEST)/melt
  93.         -ln -f $@ $(DEST)/fcat
  94.  
  95. $(DEST)/statist: statist
  96.         cp statist $@
  97.         chmod 755 $@
  98.         -strip $@
  99.         -mcs -d $@
  100.  
  101. $(MANDEST)/freeze.$(SEC): freeze.1
  102.         cp freeze.1 $@
  103.         chmod +r $@
  104.         -ln -f $@ $(MANDEST)/melt.$(SEC)
  105.         -ln -f $@ $(MANDEST)/fcat.$(SEC)
  106.  
  107. $(MANDEST)/statist.$(SEC): statist.1
  108.         cp statist.1 $@
  109.         chmod +r $@
  110.  
  111. bsd:
  112.         $(MAKE) prog CFLAGS="-O -DBSD -DUTIMES -DBITS=16\
  113.         -DFAST -DSIGTYPE=void"
  114.  
  115. sysv:
  116.         $(MAKE) prog CFLAGS="-O -DBITS=16 -DFAST -DSIGTYPE=void"\
  117.         LIBS="-lc_s"
  118.  
  119. x286:
  120.         $(MAKE) prog CC=cc CFLAGS="-Ox -Mc2 -DBITS=16 -DFAST\
  121.         -DSIGTYPE=int"
  122.  
  123. x286install:
  124.         $(MAKE) install MANDEST=/usr/man/man.C SEC=C
  125.  
  126. generic:
  127.         $(MAKE) prog CFLAGS="-O -DBITS=16 -DFAST -DSIGTYPE=int"
  128.  
  129. sun4:
  130.         $(MAKE) prog CC=cc CFLAGS="-O4 -DBSD -DSUN4 -DSIGTYPE=void\
  131.         -DUTIMES -DBITS=16 -DFAST"
  132.  
  133. os2:
  134.         $(MAKE) prog CFLAGS="-O2 -s -DOS2 -DMSDOS -DBITS=16\
  135.         -DFAST -DSIGTYPE=void" EXE=".exe" OBJS="$(OBJS) isvalid.o"\
  136.         LIBS="-los2"
  137.  
  138. ###
  139. bitio.o: freeze.h compat.h bitio.h
  140. debug.o: freeze.h compat.h huf.h bitio.h
  141. decode.o: freeze.h compat.h huf.h bitio.h
  142. default.o: freeze.h compat.h
  143. encode.o: freeze.h compat.h lz.h huf.h bitio.h
  144. freeze.o: freeze.h compat.h lz.h huf.h
  145. huf.o: freeze.h compat.h huf.h bitio.h
  146. lz.o: freeze.h compat.h lz.h
  147. statist.o: freeze.h compat.h lz.h
  148.