home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / quot210s.zip / Makefile.unx < prev    next >
Makefile  |  1998-12-15  |  5KB  |  197 lines

  1. #
  2. # Makefile for the generic Quoteriser. The file is shipped with defaults
  3. # for creating Unix ELF executables. Testing was done under Linux and
  4. # Solaris, using GCC and GNU Make. Other systems may require degrees of
  5. # massaging ranging from the trivial (e.g. Unix a.out) to the extreme
  6. # (e.g. Windows).
  7. #
  8. #      Created: 7th September 1998
  9. # Version 2.10: 2nd December 1998
  10. #
  11. # (C) 1998 Nicholas Paul Sheppard
  12. #
  13. # This file is distributed under the GNU General Public License. See the
  14. # file COPYING for details.
  15. #
  16.  
  17.  
  18. #
  19. # Directories. Mine are for compiling files from sub-directories of the
  20. # current directory into binaries in different sub-directories of the
  21. # current directory.
  22. #
  23. # SRC   - directory for source files
  24. # INCL  - directory for header files
  25. # BIN   - directory for executables
  26. # DOC   - directory for documentation
  27. # DIST  - directory into which to place distribution files
  28. # ETC   - directory for misellaneous files (icons)
  29. #
  30.  
  31. SRC   = src
  32. INCL  = include
  33. BIN   = bin
  34. DOC   = doc
  35. DIST  = .
  36. ETC   = etc
  37.  
  38. #
  39. # Compiler and linker names, options, directories, etc..
  40. #
  41. # CC       - name of the compiler
  42. # CFLAGS   - compiler flags
  43. # LD       - name of the linker
  44. # LDFLAGS  - linker flags
  45. # AR       - name of librarian
  46. # ARFLAGS  - librarian flags
  47. # O        - extension for object files
  48. # LIB      - prefix for library files
  49. # A        - extension for library files
  50. # X        - extension for executable files
  51. #
  52.  
  53. CC       = gcc
  54. CFLAGS   = -I$(INCL) -DGENERIC -Wall -O2 -fPIC
  55. LD       = gcc
  56. LDFLAGS  = -L$(BIN)
  57. AR       = gcc
  58. ARFLAGS  = -shared
  59. O        = .o
  60. LIB      = lib
  61. A        = .so
  62. X        =
  63.  
  64. #
  65. # Other programs
  66. #
  67. # RM   - command to use for deletion of files
  68. # ZIP  - command to use for archiving files
  69. # Z    - extension for archive
  70. #
  71. RM  = rm -f
  72. ZIP = tar cfvz
  73. Z   = .tar.gz
  74.  
  75. #
  76. # Targets.
  77. #
  78. # Note that there is a 'package' target at the end of the makefile, as are
  79. # the clean-* targets that actually do the work
  80. #
  81.  
  82. .PHONY: \
  83. bin lib clean spotless package clean-objs spotless-exes
  84.  
  85. all: lib
  86.     $(MAKE) -f Makefile.unx bin
  87.  
  88. bin: $(BIN)/sig$(X) $(BIN)/quoterc$(X)
  89.  
  90. lib: $(BIN)/$(LIB)quoter$(A)
  91.  
  92. clean: clean-objs
  93.  
  94. spotless: clean spotless-exes
  95.  
  96. #
  97. # Pattern rule for object files
  98. #
  99.  
  100. $(BIN)/%$(O): $(SRC)/%.c
  101.     $(CC) $(CFLAGS) -o $@ -c $<
  102.  
  103. #
  104. # Pattern rule for libraries
  105. #
  106.  
  107. $(BIN)/%$(A):
  108.     $(AR) $(ARFLAGS) -o $@ $^
  109.  
  110. #
  111. # Pattern rule for executables
  112. #
  113.  
  114. $(BIN)/%$(X):
  115.     $(LD) $(LDFLAGS) -o $@ $^ -lquoter -lgdbm -lxtype
  116.  
  117. #
  118. # Executable dependencies
  119. #
  120.  
  121. $(BIN)/sig$(X): $(BIN)/sig$(O)
  122. $(BIN)/quoterc$(X): $(BIN)/quoterc$(O)
  123.  
  124. #
  125. # Library dependencies
  126. #
  127. $(BIN)/$(LIB)quoter$(A): \
  128. $(BIN)/adb$(O) $(BIN)/asearch$(O) $(BIN)/authors$(O) $(BIN)/html$(O) \
  129. $(BIN)/htmlattr$(O) $(BIN)/qccmd$(O) $(BIN)/qcdata$(O) $(BIN)/qdb$(O) \
  130. $(BIN)/qsearch$(O) $(BIN)/quotes$(O) $(BIN)/str$(O) $(BIN)/typeset$(O)
  131.  
  132. #
  133. # Object file dependencies
  134. #
  135.  
  136. $(BIN)/adb$(O): $(SRC)/adb.c $(INCL)/authors.h
  137. $(BIN)/asearch$(O): $(SRC)/asearch.c $(INCL)/authors.h
  138. $(BIN)/authors$(O): $(SRC)/authors.c $(INCL)/authors.h
  139. $(BIN)/html$(O): $(SRC)/html.c $(INCL)/html.h $(INCL)/general.h
  140. $(BIN)/htmlattr$(O): $(SRC)/htmlattr.c $(INCL)/html.h $(INCL)/general.h
  141. $(BIN)/qccmd$(O): $(SRC)/qccmd.c $(INCL)/authors.h $(INCL)/general.h $(INCL)/quoterc.h $(INCL)/quotes.h
  142. $(BIN)/qcdata$(O): $(SRC)/qcdata.c $(INCL)/authors.h $(INCL)/quoterc.h $(INCL)/quotes.h
  143. $(BIN)/qdb$(O): $(SRC)/qdb.c $(INCL)/quotes.h
  144. $(BIN)/qsearch$(O): $(SRC)/qsearch.c $(INCL)/quotes.h
  145. $(BIN)/quoterc$(O): $(SRC)/quoterc.c $(INCL)/quoterc.h
  146. $(BIN)/quotes$(O): $(SRC)/quotes.c $(INCL)/quotes.h
  147. $(BIN)/sig$(O): $(SRC)/sig.c $(INCL)/quotes.h $(INCL)/authors.h $(INCL)/html.h $(INCL)/general.h $(INCL)/typeset.h
  148. $(BIN)/str$(O): $(SRC)/str.c $(INCL)/general.h
  149. $(BIN)/typeset$(O): $(SRC)/typeset.c $(INCL)/typeset.h $(INCL)/html.h
  150.  
  151. #
  152. # Include file dependencies
  153. #
  154. $(INCL)/quoterc.h: $(INCL)/authors.h $(INCL)/quotes.h
  155. $(INCL)/quotes.h: $(INCL)/authors.h
  156.  
  157. #
  158. # Rules for cleaning up the mess we've made
  159. #
  160.  
  161. clean-objs:
  162.     $(RM) $(BIN)/*$(O)
  163.  
  164. spotless-exes:
  165.     $(RM) $(BIN)/*$(X)
  166.  
  167. #
  168. # Rules for producing the distribution packages.
  169. #
  170. package: $(DIST)/quoteriser-2.10-src$(Z)
  171.  
  172. $(DIST)/%$(Z):
  173.     $(ZIP) $@ $^
  174.  
  175. #
  176. # This is the list of files that go into the quoteriser-2.10-src (source)
  177. # distribution file. We package all the source files even though this make
  178. # file is only for the generic build.
  179. #
  180. $(DIST)/quoteriser-2.10-src$(Z): \
  181. bin debug build.cmd install.cmd readme.txt $(DOC)/copying.txt $(ETC)/quoter.ico \
  182. Makefile Makefile.unx $(ETC)/gdbm.pat $(ETC)/gnurx.pat \
  183. $(INCL)/authors.h $(INCL)/general.h $(INCL)/html.h $(INCL)/pmutil.h \
  184. $(INCL)/qotd.h $(INCL)/quoter.h $(INCL)/quotes.h \
  185. $(INCL)/threads.h $(INCL)/types.h $(INCL)/typeset.h \
  186. $(SRC)/adb.c $(SRC)/adlg.c $(SRC)/asearch.c $(SRC)/athreads.c $(SRC)/authors.c \
  187. $(SRC)/dir.c $(SRC)/html.c $(SRC)/htmlattr.c $(SRC)/pmscroll.c $(SRC)/pmspawn.c \
  188. $(SRC)/qccmd.c $(SRC)/qcdata.c $(SRC)/qdb.c $(SRC)/qdlg.c $(SRC)/qotd.c \
  189. $(SRC)/qotd_p.c $(SRC)/qsearch.c $(SRC)/qthreads.c $(SRC)/quoter.c $(SRC)/quoterc.c \
  190. $(SRC)/quoter_p.c $(SRC)/quotes.c $(SRC)/settings.c $(SRC)/sig.c $(SRC)/str.c \
  191. $(SRC)/typeset.c $(SRC)/adlg.rc $(SRC)/qdlg.rc $(SRC)/qotd.rc $(SRC)/quoter.rc \
  192. $(SRC)/settings.rc $(SRC)/qotd.def $(SRC)/quoter.def  $(SRC)/sig.def \
  193. $(SRC)/quoterc.def $(SRC)/quoter1.def $(SRC)/quoterc.def $(SRC)/quoterdb.def \
  194. $(SRC)/quoter1d.def $(SRC)/quoterla.def \
  195. $(DOC)/history.txt $(DOC)/intro.htm $(DOC)/quoter.htm $(DOC)/quoterc.htm \
  196. $(DOC)/qotd.htm $(DOC)/sig.htm $(DOC)/source.htm
  197.