home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / os2 / hpgl312.zip / GENERIC.MAK < prev    next >
Makefile  |  1993-04-18  |  8KB  |  286 lines

  1. ###########################################################################
  2. #    Copyright (c) 1991 - 1993 Heinz W. Werntges.  All rights reserved.
  3. #    Distributed by Free Software Foundation, Inc.
  4. #
  5. # This file is part of HP2xx.
  6. #
  7. # HP2xx is distributed in the hope that it will be useful, but
  8. # WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  9. # to anyone for the consequences of using it or for whether it serves any
  10. # particular purpose or works at all, unless he says so in writing.  Refer
  11. # to the GNU General Public License, Version 2 or later, for full details
  12. #
  13. # Everyone is granted permission to copy, modify and redistribute
  14. # HP2xx, but only under the conditions described in the GNU General Public
  15. # License.  A copy of this license is supposed to have been
  16. # given to you along with HP2xx so you can know your rights and
  17. # responsibilities.  It should be in a file named COPYING.  Among other
  18. # things, the copyright notice and this notice must be preserved on all
  19. # copies.
  20. ###########################################################################
  21. #
  22. # Generic Makefile for misc. versions of hp2xx; strong emphasis on UNIXes
  23. #
  24.  
  25. # Utilities etc.:
  26. #
  27. SHELL    =    /bin/sh
  28.  
  29. CHMOD    =    chmod
  30. CP    =    cp
  31. MKINFO    =    makeinfo
  32. RM    =    rm
  33. STRIP    =    strip
  34.  
  35. # Installation sites (GNU conventions):
  36. #
  37. prefix    =    /usr/local
  38. bindir    =    $(prefix)/bin
  39. includedir =    $(prefix)/include
  40. mandir    =    $(prefix)/man
  41. man1dir    =    $(mandir)/man1
  42. infodir    =    $(prefix)/info
  43.  
  44. # CC and CFLAGS set for gcc, but any ANSI-C compiler should work.
  45. # For non-gcc compilers, simply set CFLAGS = -O (to start with)
  46. #
  47. CC    = gcc
  48. CFLAGS    = -O2 -Wall -ansi -fstrength-reduce -finline-functions
  49.  
  50. LFLAGS    =        # only sometimes needed; see below for examples
  51. CPPFLAGS= -I.        # only sometimes needed; see below for examples
  52. BINDCMD =         # only needed for EMX and DJGPP DOS extenders
  53.  
  54.  
  55.  
  56. #############################################################################
  57. # MAIN CONFIGURATION TASK:
  58. # Define the target machine / OS by uncommenting the appropriate lines below.
  59. # Remember to comment-out the defaults (a) if they do not apply!
  60. #
  61. # Generic UNIX + X11 previewer (default)
  62. #
  63. DEFINES   = -DUNIX -DHAS_UNIX_X11
  64. PREVIEWER = to_x11
  65. ALL_LIBS  = -lX11 -lm        Maybe -lX instead of -lX11 is needed?
  66. #
  67. # Generic UNIX, no previewer
  68. #
  69. # DEFINES   = -DUNIX
  70. # PREVIEWER = no_prev
  71. # ALL_LIBS  = -lm
  72. #
  73. # Convex-OS
  74. #
  75. # DEFINES   = -DUNIX -DHAS_UNIX_X11
  76. # PREVIEWER = to_x11
  77. # ALL_LIBS  = -lX11 -lm
  78. # CC      = cc
  79. # CFLAGS      = -O
  80. #
  81. # SunOS + X11 previewer
  82. #
  83. # LFLAGS    = -L$(OPENWINHOME)/lib
  84. # CPPFLAGS  = -I$(OPENWINHOME)/include
  85. # DEFINES   = -DUNIX -DHAS_UNIX_X11
  86. # PREVIEWER = to_x11
  87. # ALL_LIBS  = -lX -lm
  88. #
  89. # SunOS + Sunview previewer
  90. #
  91. # DEFINES   = -DUNIX -DHAS_UNIX_SUNVIEW
  92. # PREVIEWER = to_sunvw
  93. # ALL_LIBS  = -lsunwindow -lsuntool -lpixrect -lm
  94. #
  95. # OS/2 2.x + PM previewer, gcc/emx
  96. #
  97. # DEFINES   = -DOS2 -DHAS_OS2_PM
  98. # PREVIEWER = to_pm
  99. # ALL_LIBS  = -los2 -lm
  100. # BINDCMD   = emxbind -p c:\emx\bin\emxl.exe $(PROGRAM)
  101. #
  102. # OS/2 2.x + EMX full-screen previewer        # Planned only !
  103. #
  104. # DEFINES   = -DOS2 -DHAS_OS2_EMX
  105. # PREVIEWER = to_os2
  106. # ALL_LIBS  = -los2 -l16bit -lm
  107. # BINDCMD   = emxbind -f c:\emx\bin\emxl.exe $(PROGRAM)
  108. #
  109. #
  110. #--------------------------------------------------------------------------
  111. # Below find *fragments* of how to augment this makefile for other systems.
  112. # Note that I simply collected all definitions I am currently aware of,
  113. # but that this collection is still subject to change.
  114. #
  115. # You are welcome to improve it!
  116. #
  117. # Note also that most of the systems listed below are already supported
  118. # by special makefiles, though I'd like to make these obsolete by a
  119. # future version of this file. Currently, use the special makefile!
  120. #
  121. # I could not test the settings below, lacking a well-behaved DOS make.exe:
  122. # DOS/DJGPP + DJ previewer        # Use dosdjgpp.mak !
  123. #
  124. # DEFINES   = -DDOS -DGNU -DHAS_DOS_DJGR
  125. # PREVIEWER = to_dj_gr
  126. # ALL_LIBS  = -lgr -lm
  127. # BINDCMD   = copy /b c:\djgpp\bin\stub.exe+$(PROGRAM) $(PROGRAM).exe
  128. #
  129. # DOS / Borland bcc            # Use borland.mak !
  130. #
  131. # DEFINES   = -DDOS -DHAS_DOS_VGA
  132. # PREVIEWER = to_vga
  133. # ALL_LIBS  = -lm
  134. #
  135. # ATARI ST/TT
  136. #
  137. # DEFINES   = -DATARI            # Use atari.mak !
  138. # PREVIEWER = to_atari
  139. # ALL_LIBS  = -lm     # Add whatever may be needed for Ataris
  140. #
  141. # AMIGA
  142. #
  143. # DEFINES   = -DAMIGA            # Use amiga.mak !
  144. # PREVIEWER = to_amiga
  145. # ALL_LIBS  = -lm     # Add whatever may be needed for Amigas
  146. #
  147. # VAX/VMS    # I am still waiting for the .MMS file from the VAX people...
  148. #
  149. # DEFINES   = -DVAX
  150. # PREVIEWER = to_uis
  151. # ALL_LIBS  = -lm     # Add whatever may be needed for VMS
  152. #
  153. #############################################################################
  154. # Decide below if you want to include some extra modes:
  155. #    Recommendation: Add PIC & PAC only for ATARI
  156. #
  157. # Standard setting: No extras:
  158. EX_SRC    =
  159. EX_OBJ    =
  160. EX_DEFS    =
  161. #
  162. # Include extras:
  163. # EX_SRC    = to_pic.c to_pac.c
  164. # EX_OBJ    = to_pic.o to_pac.o
  165. # EX_DEFS    = -DPIC_PAC
  166. #
  167. #############################################################################
  168. # No user-serviceable parts below!
  169. #############################################################################
  170.  
  171. COMMON_INCS    = hp2xx.h bresnham.h
  172. ALL_INCS    = $(COMMON_INCS) chardraw.h charset0.h getopt.h x11.h ilbm.h iff.h
  173. ALL_CFLAGS    = -c $(CFLAGS)
  174.  
  175.  
  176. # $(SRCS) NOT USED YET:
  177. SRCS    = hp2xx.c hpgl.c picbuf.c bresnham.c chardraw.c getopt.c getopt1.c \
  178.       $(ALL_INCS)\
  179.       to_mf.c to_pcx.c to_pcl.c to_eps.c to_img.c to_pbm.c $(PREVIEWER).c \
  180.       $(EX_SRC)
  181.  
  182. OBJS    = hp2xx.o hpgl.o picbuf.o bresnham.o chardraw.o getopt.o getopt1.o \
  183.       to_mf.o to_pcx.o to_pcl.o to_eps.o to_img.o to_pbm.o $(PREVIEWER).o \
  184.       $(EX_OBJ)
  185.  
  186. PROGRAM    = hp2xx
  187.  
  188. default:
  189.     @echo "This makefile needs manual configuration! Edit it now!
  190.     @echo "After configuration, you may use the following commands:
  191.     @echo   ""
  192.     @echo   "make all             Compile everything"
  193.     @echo   "make check           Run a color application in preview mode"
  194.     @echo   "make install-bin     Install the binary file"
  195.     @echo   "make install-man     Install the manual page"
  196.     @echo   "make install-info    Create and install the info file"
  197.     @echo   "make install         Install everything"
  198.     @echo   "make mostlyclean"
  199.     @echo   "make clean"
  200.     @echo   "make realclean"
  201.  
  202.  
  203.  
  204. #########################################################################
  205. #                                    #
  206. #             Implicit Rules                    #
  207. #                                    #
  208. #########################################################################
  209.  
  210. all: $(OBJS)
  211.     $(CC) $(LFLAGS) $(OBJS) $(ALL_LIBS) -o $(PROGRAM)
  212.     $(BINDCMD)
  213.  
  214.  
  215. .c.o:    $< $(COMMON_INCS)
  216.     -$(RM) -f $@
  217.     $(CC) $(DEFINES) $(EX_DEFS) $(ALL_CFLAGS) $(CPPFLAGS) $<
  218.  
  219.  
  220. #########################################################################
  221. #                                    #
  222. #             Explicit Rules                    #
  223. #                                    #
  224. #########################################################################
  225.  
  226. hp2xx.info:    ../doc/hp2xxinf.tex
  227.         $(CP) ../doc/hp2xxinf.tex hp2xx.texinfo
  228.         $(MKINFO) hp2xx.texinfo
  229.  
  230. bresnham.o:    $< bresnham.h
  231.  
  232. chardraw.o:    $< $(COMMON_INCS) chardraw.h charset0.h
  233.  
  234. getopt.o:    $< getopt.h
  235.  
  236. getopt1.o:    $< getopt.h
  237.  
  238. hp2xx.o:    $< $(COMMON_INCS) getopt.h
  239.  
  240. hpgl.o:        $< $(COMMON_INCS) chardraw.h
  241.  
  242. ilbm.o:        $< $(COMMON_INCS) ilbm.h iff.h
  243.  
  244. to_x11.o:    $< $(COMMON_INCS) x11.h
  245.  
  246. #########################################################################
  247.  
  248. check:
  249.     ./$(PROGRAM) -m pre -c1234567 -h150 -w150 ../hp-tests/colors.hp
  250.  
  251. clean:
  252.     -make mostlyclean
  253.     -$(RM) -f core a.out ./hp2xx.texinfo ./hp2xx.info
  254.  
  255. distclean:
  256.     @echo make distclean -- not supported yet.
  257.  
  258. dist:
  259.     @echo make dist -- not supported yet.
  260.  
  261. mostlyclean:
  262.     -$(RM) -f *.o
  263.  
  264. realclean:
  265.     -make clean
  266.     -$(RM) -f $(PROGRAM)
  267.  
  268. TAGS:
  269.     @echo make TAGS -- not supported nor needed.
  270.  
  271. install:    install-exe install-info install-man
  272.  
  273. install-exe:    $(PROGRAM)
  274.         -$(STRIP) $(PROGRAM)
  275.         $(CP) $(PROGRAM) $(bindir)
  276.         $(CHMOD) 755 $(bindir)/$(PROGRAM)
  277.  
  278. install-info:    hp2xx.info
  279.         $(CP) hp2xx.info $(infodir)
  280.         $(CHMOD) 644 $(infodir)/hp2xx.info
  281.  
  282. install-man:    ../doc/hp2xx.1
  283.         $(CP) ../doc/hp2xx.1 $(man1dir)
  284.         $(CHMOD) 644 $(man1dir)/hp2xx.1
  285.  
  286.