home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / OS2 / MAN11A.ZIP / src / Makefile.os2 < prev    next >
Makefile  |  1994-01-06  |  5KB  |  158 lines

  1. # Makefile for man and manpath
  2. #
  3. # - for GNU gcc (emx 0.8g kit) [executables for OS/2 2.x or DOS (32-bit)]
  4. # - for Microsoft C 6.00A      [executables for OS/2 or MSDOS (16-bit)]
  5.  
  6. # To use, enter "make -f Makefile.os2" (this makefile depends on its
  7. # name being "Makefile.os2").
  8. #
  9. # Tested with dmake 3.8 and GNU make 3.68 under OS/2
  10.  
  11. SHELL=/bin/sh
  12.  
  13. default:
  14.     @echo "Enter $(MAKE) -f Makefile.os2 target                     "
  15.     @echo " where 'target' is chosen from                          " 
  16.     @echo "   msc      OS/2 exe [Microsoft C 6.00a]                "
  17.     @echo "   mscbnd   OS/2 and DOS exe [Microsoft C 6.00a]        "
  18.     @echo "   emx      OS/2 32-bit exe [EMX/gcc; uses emxlibc.dll] "
  19.  
  20. msc: 
  21.     $(MAKE) -f Makefile.os2 all \
  22.     CC="cl -nologo -AC" O=".obj" \
  23.     CFLAG="-Iinclude" \
  24.     GETOPT="getopt.obj" \
  25.     DIRECTOR="director.obj" \
  26.     LDFLAGS="-Lp"
  27.  
  28. mscbnd: 
  29.     $(MAKE) -f Makefile.os2 all \
  30.     CC="cl -nologo -AC" O=".obj" \
  31.     CFLAG="-Iinclude" \
  32.     GETOPT="getopt.obj" \
  33.     DIRECTOR="director.obj" \
  34.     LDFLAGS="-Lp" LBIND="-Fb" \
  35.     BIND="bind man.exe /n DOSQFSATTACH"
  36.  
  37. msc-debug: 
  38.     $(MAKE) -f Makefile.os2 all \
  39.     CC="cl -nologo -AC -Zi" O=".obj" \
  40.     CFLAG="-Od -Iinclude" \
  41.     GETOPT="getopt.obj" \
  42.     DIRECTOR="director.obj" \
  43.     LDFLAGS="-Lp"
  44.  
  45. emx:  
  46.     $(MAKE) -f Makefile.os2 all \
  47.     CC="gcc -Zomf -Zmtd" O=".obj" \
  48.     CFLAG="-O" \
  49.     LFLAGS="-s" \
  50.     BIT="32"
  51.  
  52. #### Start of system configuration section. ####
  53.  
  54. # If you modify these values, you should also modify the corresponding
  55. # portions of config.h.in.
  56.  
  57. srcdir = @srcdir@
  58.  
  59. pager = less
  60. man_install_flags = @man_install_flags@
  61.  
  62. DEFS = -DSTDC_HEADERS -DCOMPRESS -DDIRENT -DHAS_TROFF
  63.  
  64. CFLAGS = $(CFLAG) $(CDEBUG) $(DEFS) -DOS2
  65.  
  66. # Where to install the executables.
  67. bindir = /bin
  68. # Where to put manpath.config
  69. libdir = /bin
  70. manpath_config_file = manpath.cfg
  71.  
  72. # Where to put the manual pages.
  73. mandir = /etc/man
  74. # Extension (not including `.') for the installed manual page filenames.
  75. manext = 1
  76.  
  77. troff = groff -Tps -man
  78.  
  79. #### End of system configuration section. ####
  80.  
  81. all: man.exe manpath.exe apropos whatis makewhatis manpages
  82.  
  83. MANOBJ = man.c manpath.c gripes$O glob$O util$O \
  84.     $(DIRECTOR) $(GETOPT)
  85.  
  86. MANPATHOBJ = manpath.c gripes$O util$O $(GETOPT)
  87.  
  88. .c$O :
  89.     $(CC) $(CFLAGS) -c $<
  90.  
  91. manpath.exe: $(MANPATHOBJ) config.h manpath.h
  92.     $(CC) $(CFLAGS) -DMAIN -o $@ $(MANPATHOBJ) \
  93.     manpath$(BIT).def $(LDFLAGS) $(LBIND)
  94.  
  95. man.exe: $(MANOBJ) config.h gripes.h man$(BIT).def
  96.     $(CC) $(CFLAGS) -o $@ $(MANOBJ) man$(BIT).def $(LDFLAGS)
  97.     $(BIND)
  98.  
  99. gripes$O: gripes.h
  100. util$O: gripes.h
  101.  
  102. apropos: apropos.sh
  103.     sed -e 's,%libdir%,$(libdir),' -e 's,%bindir%,$(bindir),' \
  104.         -e 's,%pager%,$(pager),' \
  105.         apropos.sh > apropos
  106.  
  107. whatis: whatis.sh
  108.     sed -e 's,%libdir%,$(libdir),' -e 's,%bindir%,$(bindir),' \
  109.         -e 's,%pager%,$(pager),' \
  110.         whatis.sh > whatis
  111.  
  112. makewhatis: makewhatis.sh
  113.     sed -e 's/%sections%/@sections@/' makewhatis.sh > makewhatis
  114.  
  115. install: all install.man apropos whatis makewhatis
  116.     install -c $(man_install_flags) man.exe $(bindir)/man.exe
  117.     install -c -m 755 manpath.exe $(bindir)/manpath.exe
  118.     install -c -m 755 apropos $(bindir)/apropos
  119.     install -c -m 755 whatis $(bindir)/whatis
  120.     install -c -m 754 makewhatis $(bindir)/makewhatis
  121.     install -c -m 644 manpath.config $(libdir)/$(config_file)
  122.  
  123. manpages: man.$(manext) manpath.$(manext) apropos.$(manext) whatis.$(manext) 
  124.  
  125. man.$(manext): man.man
  126.     sed -e 's,%libdir%,$(libdir),' -e 's,%bindir%,$(bindir),' \
  127.         -e 's,%pager%,$(pager),' -e 's,%troff%,$(troff),' \
  128.         -e 's,%manpath_config_file%,$(config_file),' \
  129.     man.man > man.$(manext)
  130.  
  131. manpath.$(manext): manpath.man
  132.     sed -e 's,%libdir%,$(libdir),' -e 's,%bindir%,$(bindir),' \
  133.         -e 's,%pager%,$(pager),' -e 's,%troff%,$(troff),' \
  134.         -e 's,%manpath_config_file%,$(config_file),' \
  135.     manpath.man > manpath.$(manext)
  136.  
  137. apropos.$(manext): apropos.man
  138.     sed -e 's,%libdir%,$(libdir),' -e 's,%bindir%,$(bindir),' \
  139.         -e 's,%pager%,$(pager),' -e 's,%troff%,$(troff),' \
  140.         -e 's,%manpath_config_file%,$(config_file),' \
  141.     apropos.man > apropos.$(manext)
  142.  
  143. whatis.$(manext): whatis.man
  144.     sed -e 's,%libdir%,$(libdir),' -e 's,%bindir%,$(bindir),' \
  145.         -e 's,%pager%,$(pager),' -e 's,%troff%,$(troff),' \
  146.         -e 's,%manpath_config_file%,$(config_file),' \
  147.     whatis.man > whatis.$(manext)
  148.  
  149. install.man:
  150.     install -c -m 644 man.$(manext) $(mandir)/man.$(manext)
  151.     install -c -m 644 manpath.$(manext) $(mandir)/manpath.$(manext)
  152.     install -c -m 644 apropos.$(manext) $(mandir)/apropos.$(manext)
  153.     install -c -m 644 whatis.$(manext) $(mandir)/whatis.$(manext)
  154.  
  155. clean:
  156.     rm -f *.obj *.o *~ core
  157.  
  158.