home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / x / volume10 / xtrek / part03 / Imakefile < prev    next >
Makefile  |  1990-10-23  |  6KB  |  187 lines

  1. /* XTREK Imakefile sccsid = "@(#)Imakefile    3.1" */
  2.  
  3. #ifdef BandAidCompiler
  4. #include BandAidCompiler
  5. #endif
  6.  
  7. /*
  8.  * User Selectable options:
  9.  *
  10.  *  -DCUSTOMSHIP - allows players to customize their ships as described in
  11.  *          xtrek_ship(6).  If not defined, then ships are static.
  12.  *
  13.  *  -DNO_INETD - This is useful if you are using it as a long-lived daemon
  14.  *          rather than running under inetd, which you probably want
  15.  *          to do if you are not root.  Be sure to add the line
  16.  *            #define NO_INETD
  17.  *          in addition to adding -DNO_INETD to the options list; the
  18.  *          Makefile must change along with the source.
  19.  *  -DEXCLUDE - Don't allow more than one session per display.
  20.  *  -DOPENWINDOWS - Define for Suns running open windows.  Will install
  21.  *        fonts correctly.
  22.  */
  23. /*#define OPTIONS -DCUSTOMSHIP -DNO_INETD*/
  24. #define OPTIONS -DCUSTOMSHIP -DEXCLUDE
  25. /*#define NO_INETD*/
  26.  
  27. /* Default defines */
  28. #define NEWINET /* as nothing */
  29. #define SUNV    /* as nothing */
  30. #define LOC_CF    /* as nothing */
  31. #define LOC_LIB /* as nothing */
  32. #define    HPCFLAGS    /* as nothing */
  33. #define    OPENWINDOWS    /* as nothing */
  34.  
  35. #if defined(SunArchitecture) && SunOSPlatform && OSMajorVersion >= 4
  36. #undef  NEWINET
  37. #define NEWINET -DNEWINET
  38. #undef  SUNV
  39. #define SUNV    -DSUN40
  40. #undef LOC_LIB
  41. #define    LOC_LIB    -ldbm -Bstatic
  42. #undef LOC_CF
  43. #define    LOC_CF    -DNDBM
  44. #undef OPENWINDOWS
  45. #define    OPENWINDOWS    -DOPENWINDOWS
  46. #endif
  47.  
  48. #if defined(SGIArchitecture)
  49. #define NEWINET -DNEWINET
  50. #define LOC_CF  -I/usr/include/bsd
  51. #define LOC_LIB -lsun -lbsd
  52. #endif
  53.  
  54. #if defined(HPArchitecture)
  55. #undef LOC_LIB
  56. #define LOC_LIB -lBSD -lndbm
  57. #define LOC_LIB -lBSD -lndbm
  58. #undef HPCFLAGS
  59. #define HPCFLAGS -Dhpux -DSYSV -Wc,-Np500        /* For HP9000/300 */
  60. /*#define HPCFLAGS -Dhpux -DSYSV             /* For HP9000/800 */
  61. /*#define XLIB kludge.libX11.a        /* For s800, kludge.libX11.a is linked in */
  62. #endif
  63.  
  64. /* What's the daemon going to be called? */
  65. #ifdef NO_INETD
  66.        XTREKD = xtrekd
  67. #else
  68.        XTREKD = in.xtrekd
  69. #endif
  70.      XTREKDIR = /usr/lib/X11/xtrek
  71.       DEFINES = NEWINET SUNV OPTIONS LOC_CF HPCFLAGS
  72.      LOCALINC = bitmaps.h data.h defs.h planets.h struct.h xtrekfont.h \
  73.                 clock.bitmap
  74.         SRCS1 = bitmaps.c colors.c coup.c data.c death.c detonate.c dmessage.c \
  75.                 enter.c getship.c inform.c input.c interface.c main.c \
  76.                 newwin.c orbit.c phaser.c planetlist.c playerlist.c \
  77.                 pstats.c redraw.c smessage.c subdaemon.c stats.c torp.c \
  78.                 util.c warning.c random.c rmove.c scorelist.c \
  79.                 trigtab.c itoa.c minisubs.c war.c DBG.c
  80.         OBJS1 = bitmaps.o colors.o coup.o data.o death.o detonate.o dmessage.o \
  81.                 enter.o getship.o inform.o input.o interface.o main.o \
  82.                 newwin.o orbit.o phaser.o planetlist.o playerlist.o \
  83.                 pstats.o redraw.o smessage.o subdaemon.o stats.o torp.o \
  84.                 util.o warning.o random.o rmove.o scorelist.o \
  85.                 trigtab.o itoa.o minisubs.o war.o DBG.o
  86.     LINTFILES = bitmaps.ln colors.ln coup.ln data.ln death.ln detonate.ln \
  87.                 dmessage.ln enter.ln getship.ln inform.ln input.ln \
  88.                 interface.ln main.ln newwin.ln orbit.ln phaser.ln \
  89.                 planetlist.ln playerlist.ln pstats.ln redraw.ln smessage.ln \
  90.                 subdaemon.ln stats.ln torp.ln util.ln warning.ln random.ln \
  91.                 rmove.ln scorelist.ln trigtab.ln itoa.ln minisubs.ln \
  92.                 war.ln DBG.ln
  93.         SRCS2 = xtrek.c
  94.         OBJS2 = xtrek.o
  95.         SRCS3 = xtrekb.c
  96.         OBJS3 = xtrekb.o
  97.          SRCS = $(SRCS1) $(SRCS2) $(SRCS3)
  98.         SRCSF = xtrek.bdf
  99.         OBJSF = xtrek.snf
  100.          OBJS = $(OBJSF)
  101.      PROGRAMS = bitmaps.h xtrek $(XTREKD) xtrekb
  102.      INCLUDES = -I$(TOP)
  103.      LINTOPTS = -iabchu
  104.          LIBS = LOC_LIB $(XLIB) -lm
  105.            FC = bdftosnf
  106.  
  107. .SUFFIXES: .ln
  108.  
  109. AllTarget($(PROGRAMS))
  110. SingleProgramTarget(xtrek,$(OBJS2),,LOC_LIB)
  111. SingleProgramTarget($(XTREKD),$(OBJS1),,$(LIBS))
  112. SingleProgramTarget(xtrekb,$(OBJS3),,$(LIBS))
  113. MakeFonts()
  114. FontTarget(xtrek)
  115. AllTarget($(OBJSF))
  116. DependTarget()
  117.  
  118. #ifdef NO_INETD
  119. InstallProgram($(XTREKD),$(BINDIR))
  120. #else
  121. InstallProgram($(XTREKD),$(XTREKDIR))
  122. #endif
  123. InstallProgram(xtrek,$(BINDIR))
  124. InstallProgram(xtrekb,$(BINDIR))
  125. InstallManPage(xtrek,$(MANDIR))
  126. InstallManPage(xtrekb,$(MANDIR))
  127. InstallManPage(xtrek_ship,$(MANDIR))
  128. InstallFonts($(XTREKDIR))
  129.  
  130. bitmaps.h:   bitmaps.c
  131.     sed -e '1i\
  132.         /* DO NOT EDIT THIS FILE. It is machine generated. */'\
  133.         -e 's/[     ]*=[     ]*{[     ]*$$/;\
  134.         %MARKTEXT%/'\
  135.         bitmaps.c |\
  136.     sed -e 's/^char/extern char/'\
  137.         -e 's/^Pixmap/extern Pixmap/'\
  138.         -e '/[     ]*%MARKTEXT%[     ]*$$/,/[     ]*}[     ]*;[     ]*$$/d'\
  139.         > bitmaps.h
  140.  
  141. install::
  142.     -mkdir $(XTREKDIR)
  143.     touch $(XTREKDIR)/planets $(XTREKDIR)/motd
  144.     touch $(XTREKDIR)/scores.dir $(XTREKDIR)/scores.pag
  145.     chmod 600 $(XTREKDIR)/planets $(XTREKDIR)/motd
  146.     chmod 644 $(XTREKDIR)/scores.dir $(XTREKDIR)/scores.pag
  147.     chmod u+s $(XTREKDIR)/$(XTREKD)
  148.     -chmod u+w $(XTREKDIR)/xtrek.doc
  149.     -cp doc $(XTREKDIR)/xtrek.doc
  150.     chmod 444 $(XTREKDIR)/xtrek.doc
  151. #if defined(OPENWINDOWS)
  152.     -(convertfont xtrek.bdf; bldfamily)
  153.     -cp xtrek.ff xtrek31.fb Families.list Synonyms.list $(XTREKDIR)
  154.     -chmod 444 $(XTREKDIR)/xtrek.ff $(XTREKDIR)/xtrek31.fb
  155.     -chmod 444 $(XTREKDIR)/Families.list $(XTREKDIR)/Synonyms.list
  156. #endif
  157.  
  158. #ifdef NO_INETD
  159. install::
  160.     chmod 4711 $(BINDIR)/$(XTREKD)
  161. #endif
  162.  
  163. lint: $(LINTFILES)
  164.     $(LINT) $(LINTXLIB) *.ln > xtrek.lint 2>&1
  165.  
  166. /* This is only used on HP 9000/800 to hide duplicate symbols. */
  167. kludge.X11.a:    /usr/lib/libX11.a
  168.     cp /usr/lib/libX11.a kludge.libX11.a    # Copy X11 lib
  169.     chmod u+w kludge.libX11.a        # make our copy writeable
  170.     ar xv kludge.libX11.a Berklib.o        # Copy offending module
  171.     ld -r -o templib.o -h bcopy -h random -h srandom Berklib.o # Hide syms
  172.     ar dv kludge.libX11.a Berklib.o        # Remove offending module
  173.     ar rv kludge.libX11.a templib.o        # Add fixed module
  174.     /bin/rm templib.o            # Remove temp file
  175.  
  176. shar:
  177.     makekit -s50k -oMANIFEST READ* INSTALL* TODO xtrek.man xtrek_ship.man xtrekb.man Imakefile Makefile doc *.h *.c xtrek.bdf clock.bitmap
  178.  
  179. cpio:
  180.     for i in READ* INSTALL* TODO xtrek.man xtrek_ship.man xtrekb.man Imakefile Makefile doc *.h *.c xtrek.bdf clock.bitmap; do /bin/echo $$i; done | cpio -ocB > xtrek.cpio
  181.  
  182. tar:
  183.     tar cf xtrek.tar READ* INSTALL* TODO xtrek.man xtrek_ship.man xtrekb.man Imakefile Makefile doc *.h *.c xtrek.bdf clock.bitmap
  184.  
  185. .c.ln:
  186.     $(LINT) $(LINTFLAGS) $< > $*.p1 2>&1
  187.