home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / lib / libg++ / Makefile.gnu < prev    next >
Encoding:
Makefile  |  1991-02-18  |  8.2 KB  |  277 lines

  1. # Makefile for GNU C++ class library (libg++)
  2. #   Copyright (C) 1989 Free Software Foundation, Inc.
  3. #   written by Doug Lea (dl@rocky.oswego.edu)
  4.  
  5. #This file is part of GNU libg++.
  6.  
  7. #GNU libg++ is free software; you can redistribute it and/or modify
  8. #it under the terms of the GNU General Public License as published by
  9. #the Free Software Foundation; either version 1, or (at your option)
  10. #any later version.
  11.  
  12. #GNU libg++ is distributed in the hope that it will be useful,
  13. #but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. #GNU General Public License for more details.
  16.  
  17. #You should have received a copy of the GNU General Public License
  18. #along with GNU libg++; see the file COPYING.  If not, write to
  19. #the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  
  21. ###########################################################################
  22. #
  23. # Directories, paths, compilation flags and program names.
  24. #
  25. # Please make sure these are correct.
  26. #
  27.  
  28. # ------ source locations
  29.  
  30. # Manually set PWD to *this* directory if you are not using gnu make
  31. PWD := $(shell pwd)
  32. #PWD=/home/dl/libg++
  33.  
  34. # source include directory 
  35. SRCIDIR= $(PWD)/g++-include
  36.  
  37. # the genclass program
  38. GENCLASS=$(PWD)/genclass
  39. # and its directory of prototype files
  40. PROTODIR=$(PWD)/g++-include/gen
  41.  
  42. # ------ installation destinations
  43. # ------ You will require write-permission on the destination directories
  44. # ------ in order to `make install'
  45.  
  46. # set `prefix' to something else if you want to install things
  47. # in nonstandard places
  48.  
  49. prefix =/usr/gnu
  50.  
  51. # libg++.a destination
  52. LIBDIR = $(prefix)/lib
  53.  
  54. # executables directory: location to install the genclass class generator
  55. BINDIR = $(prefix)/bin
  56.  
  57. # directory to install man pages
  58. MANDIR= $(prefix)/man
  59.  
  60. # location to install include file directory
  61. IDIR = $(prefix)/lib/g++-include
  62.  
  63.  
  64. # ------- System-dependent defines
  65. # ------- use the second form of each for SystemV (USG)
  66.  
  67. # g++ flags
  68. OSFLAG=
  69. #OSFLAG = -DUSG
  70.  
  71. # other compilation control flags -- use any combination
  72.  
  73. # use this only if you have a strange stdio implementation
  74. #XTRAFLAGS = -DDEFAULT_filebuf
  75.  
  76. # use this if you do not want gnulib3 in libg++.a
  77. #XTRAFLAGS = -DNO_GNULIB3
  78.  
  79. # use this if you need COFF encapulation defined in gnulib3
  80. #XTRAFLAGS = -DCOFF_ENCAPSULATE
  81.  
  82. # use this if you want to disable line buffering for stream output
  83. #XTRAFLAGS = -DNO_LINE_BUFFER_STREAMBUF
  84.  
  85. # Use this to disable placing libg++ version of malloc in libg++.a 
  86. #XTRAFLAGS = -DNO_LIBGXX_MALLOC
  87.  
  88. # Please use this & send me some results of malloc_stats() sometime
  89. # (it is off by default, since stat gathering hurts performance)
  90. #XTRAFLAGS = -DMALLOC_STATS
  91.  
  92. #suggested for NeXT by cdr@acc.stolaf.edu
  93. #XTRAFLAGS = -DNO_GNULIB3 -DNO_LIBGXX_MALLOC
  94.  
  95. # ld or ld++ flags
  96. OSLDFLAG =
  97. #OSLDFLAG= -lPW
  98.  
  99. # how to install
  100. INSTALL=install -c
  101. #INSTALL=cp
  102.  
  103. # ranlib if necessary
  104. RANLIB=ranlib
  105. #RANLIB=echo
  106.  
  107. # which make?
  108. MAKE=make
  109.  
  110. #which ar?
  111. AR=ar
  112.  
  113. # not used, but convenient for those who preprocess things while compiling
  114. SHELL=/bin/sh
  115.  
  116.  
  117. # ------ compiler names
  118.  
  119. # GNU C++ compiler name
  120. GXX = g++
  121. #GXX=gcc
  122.  
  123. # GNU CC compiler name (needed for some .c files in libg++.a)
  124. CC = gcc
  125.  
  126. # GNU loader
  127. LDXX = $(LIBDIR)/gcc-ld
  128. #LDXX = $(LIBDIR)/gcc-ld++
  129.  
  130. # crt0+.o location (for dynamic loading tests)
  131. GXXCRT1=$(LIBDIR)/crt1+.o
  132.  
  133. # ------ Other compilation flags
  134. # ------ modify as you like -- the ones here are sheer overkill
  135. # ------ However, You MUST compile libg++.a with EITHER -O OR
  136. # ------ -DUSE_LIBGXX_INLINES or both
  137.  
  138. GXX_OPTIMIZATION_FLAGS= -O -fstrength-reduce  -felide-constructors -fschedule-insns -fdelayed-branch -fsave-memoized 
  139.  
  140. #GXX_OPTIMIZATION_FLAGS=-DUSE_LIBGXX_INLINES
  141.  
  142. GCC_OPTIMIZATION_FLAGS= -O -fstrength-reduce -fdelayed-branch 
  143.  
  144. DEBUG_FLAGS= -g
  145.  
  146. #use this only if you like to look at lots of useless messages
  147. #VERBOSITY_FLAGS= -Wall -v 
  148. VERBOSITY_FLAGS= -Wall
  149.  
  150. GXX_INCLUDE_DIRS= -I$(SRCIDIR)
  151.  
  152. GCC_INCLUDE_DIRS= -I$(prefix)/lib/gcc-include -I/usr/include -I$(SRCIDIR)
  153.  
  154. #use this only if you use GNU as (gas) or other assemblers that 
  155. #can read from pipes. 
  156. PIPE_AS= -pipe
  157. #PIPE_AS=
  158.  
  159. # Flags for all C++ compiles
  160. GXXFLAGS = $(OSFLAG) $(GXX_INCLUDE_DIRS) $(DEBUG_FLAGS) $(GXX_OPTIMIZATION_FLAGS) $(VERBOSITY_FLAGS) $(XTRAFLAGS) $(PIPE_AS)
  161.  
  162. # Flags for all C compiles
  163. CFLAGS= $(OSFLAG) $(GCC_INCLUDE_DIRS) $(DEBUG_FLAGS) $(GCC_OPTIMIZATION_FLAGS) $(VERBOSITY_FLAGS) $(XTRAFLAGS) $(PIPE_AS)
  164.  
  165. # g++ load time flags 
  166. GXXLDFLAGS = -L$(PWD)/src -lg++ -lm $(OSLDFLAG)
  167.  
  168. # Comment out the next line to disable incremental linking test
  169. # (this test NOT included in 1.39.0, so don't re-enable)
  170. #TEST0=test0
  171. TEST0=
  172.  
  173. ###########################################################################
  174. #
  175. # compilation actions
  176. #
  177.  
  178.  
  179.  
  180.  
  181. src: FORCE
  182.     (cd src; $(MAKE) GXX="$(GXX)"  GXXFLAGS="$(GXXFLAGS)" GXXLDFLAGS="$(GXXLDFLAGS)" LIBDIR="$(LIBDIR)" SRCIDIR="$(SRCIDIR)" CC="$(CC)" CFLAGS="$(CFLAGS)" RANLIB="$(RANLIB)" LDXX="$(LDXX)" GXXCRT1="$(GXXCRT1)" MAKE="$(MAKE)" prefix="$(prefix)" VPATH="$(SRCIDIR)" AR="$(AR)" PROTODIR="$(PROTODIR)" GENCLASS="$(GENCLASS)")
  183.  
  184. tests: FORCE
  185.     (cd tests;    $(MAKE) checktests GXX="$(GXX)"  GXXFLAGS="$(GXXFLAGS)" GXXLDFLAGS="$(GXXLDFLAGS)" LIBDIR="$(LIBDIR)" SRCIDIR="$(SRCIDIR)" CC="$(CC)" CFLAGS="$(CFLAGS)" RANLIB="$(RANLIB)" LDXX="$(LDXX)" GXXCRT1="$(GXXCRT1)" MAKE="$(MAKE)" prefix="$(prefix)" AR="$(AR)" TEST0="$(TEST0)" PROTODIR="$(PROTODIR)" GENCLASS="$(GENCLASS)")
  186.  
  187. etc: FORCE
  188.     (cd etc;    $(MAKE) GXX="$(GXX)"  GXXFLAGS="$(GXXFLAGS)" GXXLDFLAGS="$(GXXLDFLAGS)" LIBDIR="$(LIBDIR)" SRCIDIR="$(SRCIDIR)" CC="$(CC)" CFLAGS="$(CFLAGS)" RANLIB="$(RANLIB)" LDXX="$(LDXX)" GXXCRT1="$(GXXCRT1)" MAKE="$(MAKE)" prefix="$(prefix)" AR="$(AR)" PROTODIR="$(PROTODIR)" GENCLASS="$(GENCLASS)")
  189.  
  190. run_etc: FORCE
  191.     (cd etc;    $(MAKE) run_tests GXX="$(GXX)"  GXXFLAGS="$(GXXFLAGS)" GXXLDFLAGS="$(GXXLDFLAGS)" LIBDIR="$(LIBDIR)" SRCIDIR="$(SRCIDIR)" CC="$(CC)" CFLAGS="$(CFLAGS)" RANLIB="$(RANLIB)" LDXX="$(LDXX)" GXXCRT1="$(GXXCRT1)" MAKE="$(MAKE)" prefix="$(prefix)" AR="$(AR)" PROTODIR="$(PROTODIR)" GENCLASS="$(GENCLASS)")
  192.  
  193. gperf: FORCE
  194.     (cd gperf;    $(MAKE) GXX="$(GXX)"  GXXFLAGS="$(GXXFLAGS)" GXXLDFLAGS="$(GXXLDFLAGS)" LIBDIR="$(LIBDIR)" SRCIDIR="$(SRCIDIR)" CC="$(CC)" CFLAGS="$(CFLAGS)" RANLIB="$(RANLIB)" LDXX="$(LDXX)" GXXCRT1="$(GXXCRT1)" prefix="$(prefix)" AR="$(AR)" PROTODIR="$(PROTODIR)" GENCLASS="$(GENCLASS)")
  195.  
  196. genclass: genclass.sh
  197.     echo "/^PROTODIR=/c\\" > sedscript
  198.     echo "PROTODIR=$$\{PROTODIR-$(IDIR)/gen\}" >> sedscript
  199.     sed -f sedscript < genclass.sh > genclass
  200.     chmod 0755 genclass
  201.     rm -f sedscript
  202.  
  203. #to force sub-makes
  204. FORCE:
  205.  
  206.  
  207. ###########################################################################
  208. #
  209. # Installation
  210. #
  211.  
  212. MAKE_ENVIRON=\
  213.     BINDIR=$(BINDIR) \
  214.     LIBDIR=$(LIBDIR) \
  215.     MANDIR=$(MANDIR) \
  216.     INSTALL="$(INSTALL)"
  217.  
  218. all: src tests genclass etc gperf 
  219.  
  220. install:  install-lib install-include-files install-progs
  221.  
  222. install-lib:
  223.     (cd src; $(MAKE) $(MAKE_ENVIRON) install)
  224.  
  225. install-progs:
  226.     (cd etc; $(MAKE) $(MAKE_ENVIRON) install)
  227.     (cd gperf; $(MAKE) $(MAKE_ENVIRON) install)
  228.     $(INSTALL) genclass $(BINDIR)
  229.  
  230. install-include-files:
  231.     -mkdir $(IDIR)
  232.     -mkdir $(IDIR)/sys
  233.     -mkdir $(IDIR)/gen
  234.     cd $(SRCIDIR); \
  235.     FILES=`find . ! -type d  -print`; \
  236.     cd gen; \
  237.     GFILES=`find . ! -type d -print`;\
  238.     cd $(IDIR); \
  239.     rm -fr $$FILES; \
  240.     rm -f $$GFILES; \
  241.     cd $(SRCIDIR); \
  242.     FILES=`find . ! -type d  -print`; \
  243.     for file in $$FILES; do \
  244.         rm -f $(IDIR)/$$file; \
  245.         cp $$file $(IDIR)/$$file; \
  246.         chmod 0444 $(IDIR)/$$file; \
  247.         echo $$file installed; \
  248.     done
  249.  
  250.  
  251. ###########################################################################
  252. #
  253. # Destructors
  254. #
  255.  
  256. clean:
  257.     rm -f *.o *~ \#* *.bak *.pl a.out 
  258.     cd tests; $(MAKE) clean
  259.     cd etc; $(MAKE) clean
  260.     cd gperf; $(MAKE) clean
  261.  
  262. realclean:
  263.     cd src; $(MAKE) realclean
  264.     cd tests; $(MAKE) realclean
  265.     cd etc; $(MAKE) realclean
  266.     cd gperf; $(MAKE) realclean
  267.     -rm -f genclass
  268.     -rm -f libg++.info* libg++.?? libg++.??s libg++.log libg++.toc libg++.*aux
  269.     -rm -f *.orig src/*.orig tests/*.orig etc/*.orig g++-include/*.orig g++-include/sys/*.orig g++-include/gen/*.orig
  270.     -rm -f *.rej src/*.rej tests/*.rej etc/*.rej g++-include/*.rej g++-include/sys/*.rej g++-include/gen/*.rej
  271.     -rm -f *~ src/*~ tests/*~ etc/*~ g++-include/*~ g++-include/sys/*~ g++-include/gen/*~
  272.     -rm -f a.out src/a.out tests/a.out etc/a.out 
  273.     -rm -f *.s src/*.s tests/*.s etc/*.s 
  274.  
  275.  
  276. .PHONY: src tests genclass etc gperf FORCE install install-include-files 
  277.