home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / XAP / XGAMES / SPIDER.TAR / spider / Imakefile < prev    next >
Encoding:
Makefile  |  1991-09-28  |  7.2 KB  |  320 lines

  1. /**/# Run imake -DUseInstalled -I/usr/lib/X11/config to make a Makefile.
  2. /**/# This is an R5 style Imakefile, so will need the R5 config files to
  3. /**/# to make a Makefile.  It also assume that X11 is installed in /usr/lib.
  4.  
  5.         SHAR = shar
  6.         COMPRESS = compress
  7.         BTOA = btoa
  8.         SPLIT = split
  9.         CAT = cat
  10. /***** Note: probably want to define this to be something else *****/
  11.         HELPDIR = help
  12.  
  13. /***** Note:  Used to over-ride some declarations in the default Imakefile
  14.               configurations.  If you want to use some of these things, then
  15.               set OverrideDefs to YES below and change the corresponding
  16.               definitions to what you would like them to be below.  Delete
  17.               or comment out those you do not wish to use  *****/
  18. #ifndef OverrideDefs
  19. #define OverrideDefs YES
  20. #endif
  21.  
  22. #if OverrideDefs
  23.  
  24. # ifdef ManSuffix
  25. #  undef ManSuffix
  26. #  define ManSuffix 1
  27. # else
  28. #  define ManSuffix 1
  29. # endif
  30.         MANSUFFIX = ManSuffix
  31.         MANDIR = ./man$(MANSUFFIX)
  32.         BINDIR = ./bin
  33.         MKDIRHIER = /usr/bin/X11/mkdirhier
  34.  
  35. #endif /* OverrideDefs */
  36.  
  37. /***** Note:  if your OS or libc does not have usleep defined, set this
  38.               to YES.  (SunOS is one that does have usleep in libc) *****/
  39. #ifndef NeedsLocalUsleep
  40. #define NeedsLocalUsleep NO
  41. #endif
  42.  
  43. /***** Note:  if your OS or libc does not have strdup defined, set this
  44.               to YES.  (SunOS is one that does have strdup in libc) *****/
  45. #ifndef NeedsLocalStrdup
  46. #define NeedsLocalStrdup NO
  47. #endif
  48.  
  49. /***** Note:  only need XViewHasOlgx when using XView 2.0 or greater *****/
  50. #ifndef XViewHasOlgx
  51. #define XViewHasOlgx YES
  52. #endif
  53.  
  54. /***** Note:  cannot have CompileXlibOnly, CompileXView, and CompileXAW 
  55.               all be true.  Need to pick one *****/
  56. #ifndef CompileXlibOnly
  57. #define CompileXlibOnly NO
  58. #endif
  59.  
  60. #ifndef CompileXView
  61. #define CompileXView NO
  62. #endif
  63.  
  64. #ifndef CompileXAW
  65. #define CompileXAW YES
  66. #endif
  67.  
  68. #if CompileXlibOnly
  69. # if CompileXView
  70. #  undef CompileXView
  71. # endif
  72. # if CompileXAW
  73. #  undef CompileXAW
  74. # endif
  75. #elif CompileXView
  76. # if CompileXAW
  77. #  undef CompileXAW
  78. # endif
  79. #endif
  80.  
  81. /***** Note:  cannot have both Round Cards and Small Cards be true *****/
  82. #ifndef RoundCards
  83. #define RoundCards YES
  84. #endif
  85.  
  86. #ifndef SmallCards
  87. #define SmallCards NO
  88. #endif
  89.  
  90. #if SmallCards
  91. # if RoundCards
  92. #  undef RoundCards
  93. # endif
  94. #endif
  95.  
  96. #if CompileXView
  97. /**/# If these are not defined in the site.def file, define them now.
  98. /**/# set up compile time dependencies for XView clients.
  99.         XVTOP = $(XVIEWHOME)
  100.         XVLIBSRC = $(XVTOP)/lib
  101. # if UseInstalled
  102.         DEPXVIEWLIB =
  103.         DEPOLGXLIB =
  104. # else
  105.         DEPXVIEWLIB = $(XVLIBSRC)/libxview.a
  106. #  if XViewNeedsOlgx
  107.         DEPOLGXLIB = $(XVLIBSRC)/libolgx.a
  108. #  else
  109.         DEPOLGXLIB =
  110. #  endif
  111. # endif
  112.         XVIEWLIB = -L$(XVLIBSRC) -lxview
  113. # if XViewNeedsOlgx
  114.         OLGXLIB = -L$(XVLIBSRC) -lolgx
  115. # else
  116.         OLGXLIB =
  117. # endif
  118. #endif /* CompileXView */
  119.  
  120.         KL_DIST = main.c
  121. #if CompileXlibOnly
  122. # if RoundCards
  123.         DEPLIBS = $(DEPXMULIB) $(DEPXLIB)
  124.         LOCAL_LIBRARIES = $(XMULIB) $(XLIB)
  125. # else
  126.         DEPLIBS = $(DEPXLIB)
  127.         LOCAL_LIBRARIES = $(XLIB)
  128. # endif
  129.         TKOBJS = main.o
  130.  
  131.         TKSRCS = main.c
  132.  
  133.         TKHEADERS = 
  134.  
  135.         TKBITMAPS = 
  136.  
  137.         TKDOCS = 
  138.  
  139.         TKDEFINES = -DKITLESS
  140.  
  141.         TKINCLUDES = 
  142.  
  143.         TARGET = spider
  144. #endif /* CompileXlibOnly */
  145.  
  146.         XVIEW_DIST = xv_ui.c xv_stubs.c xv_ui.h spider.info
  147. #if CompileXView
  148. # if RoundCards
  149.         DEPLIBS = $(DEPXVIEWLIB) $(DEPOLGXLIB) $(DEPXMULIB) $(DEPXLIB)
  150.         LOCAL_LIBRARIES = $(XVIEWLIB) $(OLGXLIB) $(XMULIB) $(XLIB)
  151. # else
  152.         DEPLIBS = $(DEPXVIEWLIB) $(DEPOLGXLIB) $(DEPXLIB)
  153.         LOCAL_LIBRARIES = $(XVIEWLIB) $(OLGXLIB) $(XLIB)
  154. # endif
  155.         TKOBJS = xv_ui.o xv_stubs.o 
  156.  
  157.         TKSRCS = xv_ui.c xv_stubs.c
  158.  
  159.         TKHEADERS = xv_ui.h
  160.  
  161.         TKBITMAPS = 
  162.  
  163.         TKDOCS = spider.info 
  164.  
  165.         TKDEFINES = -DXVIEW
  166.  
  167.         TKINCLUDES = -I$(XVTOP)/include 
  168.  
  169.         TARGET = spider
  170. #endif /* CompileXView */
  171.  
  172.         XAW_DIST = xaw_ui.c xaw_stubs.c xaw_ui.h
  173. #if CompileXAW
  174.         DEPLIBS = XawClientDepLibs
  175.         LOCAL_LIBRARIES = XawClientLibs
  176.  
  177.         TKOBJS = xaw_ui.o xaw_stubs.o
  178.  
  179.         TKSRCS = xaw_ui.c xaw_stubs.c
  180.  
  181.         TKHEADERS = xaw_ui.h
  182.  
  183.         TKBITMAPS = 
  184.  
  185.         TKDOCS =
  186.  
  187.         TKDEFINES = -DXAW 
  188.  
  189.         TKINCLUDES = 
  190.  
  191.         TARGET = spider
  192. #endif /* CompileXAW */
  193.  
  194. BASE_OBJS = gfx.o spider.o events.o windows.o movelog.o util.o version.o
  195. OBJS = $(BASE_OBJS) $(TKOBJS)
  196.  
  197. BASE_SRCS = gfx.c spider.c events.c windows.c movelog.c util.c version.c
  198. SRCS =  $(BASE_SRCS) $(TKSRCS)
  199.  
  200. BASE_HEADERS = globals.h defs.h assert.h copyright.h
  201. HEADERS = $(BASE_HEADERS) $(TKHEADERS)
  202.  
  203. BASE_BITMAPS = rank.bm suit.bm face.bm spider.bm cards.bm.aa cards.bm.ab
  204. BITMAPS = $(BASE_BITMAPS) $(TKBITMAPS)
  205.  
  206. BASE_DOCS = doc.intro doc.rules doc.controls doc.examples doc.misc doc.summary 
  207. DOCS =        $(BASE_DOCS) $(TKDOCS)
  208.  
  209. MISC = Imakefile Makefile.sunpro README spider.man
  210.  
  211. ALL_SRCS = $(MISC) $(BASE_SRCS) $(BASE_HEADERS) $(BASE_BITMAPS) $(BASE_DOCS) \
  212.         $(XVIEW_DIST) $(XAW_DIST) $(KL_DIST)
  213.  
  214. #if NeedsLocalUsleep
  215. # if NeedsLocalStrdup
  216. UTILDEFS = -DLOCAL_USLEEP -DLOCAL_STRDUP
  217. # else
  218. UTILDEFS = -DLOCAL_USLEEP
  219. # endif
  220. #else
  221. # if NeedsLocalStrdup
  222. UTILDEFS = -DLOCAL_STRDUP
  223. # else
  224. UTILDEFS = 
  225. # endif
  226. #endif
  227.  
  228. #if SmallCards
  229. DEFINES = $(TKDEFINES) -DSMALL_CARDS -DHELPDIR="\"$(HELPDIR)\"" $(UTILDEFS)
  230. #else 
  231. # if RoundCards
  232. DEFINES = $(TKDEFINES) -DROUND_CARDS -DHELPDIR="\"$(HELPDIR)\"" $(UTILDEFS)
  233. # else
  234. DEFINES = $(TKDEFINES) -DHELPDIR="\"$(HELPDIR)\"" $(UTILDEFS)
  235. # endif
  236. #endif
  237.  
  238. INCLUDES = -I. $(TKINCLUDES)
  239.  
  240. CPPFLAGS = 
  241.  
  242. all:: $(TARGET)
  243.  
  244. #if SmallCards
  245. all:: 
  246.     -@if [ ! -f cards.bm ]; then cat cards.bm.aa cards.bm.ab > cards.bm; fi
  247. #endif
  248. #if OverrideDefs
  249. MakeDirectories(install,$(BINDIR))
  250. MakeDirectories(install.man, $(MANDIR))
  251. #endif
  252.  
  253. ComplexProgramTarget($(TARGET))
  254.  
  255. #ifdef SparcArchitecture
  256. /**/# SunOS4.0.3 sparc optimizer slimes this file
  257. util.o:    util.c
  258.     $(CC) $(CPPFLAGS) $(DEFINES) $(INCLUDES) -c util.c
  259. #endif
  260.  
  261. version.o:    version.c
  262.     $(CC) -DDATE="\"`date`\"" -c version.c 
  263.  
  264. MakeDirectories(install.doc,$(HELPDIR))
  265. InstallMultipleDest(install.doc,$(DOCS),$(HELPDIR))
  266.     
  267. World::  
  268.     @echo ""
  269.     @echo "Begin build of the $(TARGET) application for the"
  270. #if CompileXView
  271.     @echo "XView toolkit version."
  272. #else
  273. # if CompileXlibOnly
  274.     @echo "Xlib only, no toolkit version."
  275. # else
  276. #  if CompileXAW
  277.     @echo "Athena Widget toolkit version."
  278. #  endif
  279. # endif
  280. #endif
  281. #if SmallCards
  282.     @echo "Using cards with small bitmaps for a low resolution display."
  283. #else 
  284. # if RoundCards
  285.     @echo "Using cards with normal bitmaps and optional rounded edges."
  286. # else
  287.     @echo "Using cards with normal bitmaps."
  288. # endif
  289. #endif
  290.     @echo ""
  291.     @date
  292.     @echo ""
  293.     $(MAKE) $(MFLAGS) clean
  294.     $(MAKE) $(MFLAGS) depend
  295.     $(MAKE) $(MFLAGS)
  296.     @echo ""
  297.     @date
  298.     @echo ""
  299.     @echo "Begin installation... "
  300.     $(MAKE) $(MFLAGS) -k install
  301.     $(MAKE) $(MFLAGS) -k install.doc
  302.     $(MAKE) $(MFLAGS) -k install.man
  303.     @echo ""
  304.     @date
  305.     @echo ""
  306.     @echo "Installation complete...now type 'make clean'"
  307.  
  308. clean::
  309.     $(RM) spider.shar spider.a spider.a.a?a cards.bm
  310.  
  311. shar::
  312.     $(SHAR) $(ALL_SRCS) > spider.shar
  313.  
  314. dist::    shar
  315.     $(RM) spider.shar.Z
  316.     $(COMPRESS) spider.shar
  317.     $(CAT) spider.shar.Z | $(BTOA) > spider.a
  318.     $(SPLIT) spider.a spider.a.
  319.  
  320.