head	1.12;
access;
symbols
	r2_1:1.9
	r2_0:1.8
	Eglin_alpha_1:1.4;
locks
	thoth:1.12; strict;


1.12
date	94.10.11.18.16.21;	author thoth;	state Exp;
branches;
next	1.11;

1.11
date	94.10.06.18.34.52;	author thoth;	state Exp;
branches;
next	1.10;

1.10
date	94.09.23.16.01.45;	author thoth;	state Exp;
branches;
next	1.9;

1.9
date	94.09.16.18.18.15;	author thoth;	state Exp;
branches;
next	1.8;

1.8
date	94.08.18.22.12.45;	author thoth;	state Exp;
branches;
next	1.7;

1.7
date	94.05.17.17.45.44;	author thoth;	state Exp;
branches;
next	1.6;

1.6
date	94.03.02.14.25.21;	author thoth;	state Exp;
branches;
next	1.5;

1.5
date	93.07.17.11.31.56;	author thoth;	state Exp;
branches;
next	1.4;

1.4
date	92.09.16.17.17.16;	author thoth;	state Exp;
branches;
next	1.3;

1.3
date	92.08.23.13.39.30;	author thoth;	state Exp;
branches;
next	1.2;

1.2
date	92.07.07.10.41.55;	author thoth;	state Exp;
branches;
next	1.1;

1.1
date	92.06.24.12.19.57;	author thoth;	state Exp;
branches;
next	;


desc
@this is the build template for all GNUmakefiles in the
subdirectories.
@


1.12
log
@Explicitly provide the repository directory name.
spotless was missing a spot before.
@
text
@# make template for src's subdirectories.  It contains definitions for
# standard targets.

M4=/local/gnu/m4
PERL=perl

AR=/usr/bin/ar
#ARL=l
RANLIB=/usr/bin/ranlib

SYSTEM=CFront

all: headers lib

# we will not use Sun's target definitions
###   include make/default.mk
.SUFFIXES: ${SUFFIXES} .C .m4c .m4h
OUTPUT_OPTION=
COMPILE.cc=$(CCC) $(CCFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
LINK.cc=$(CCC) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)
.C:
	$(LINK.cc) -o $@@ $< $(LDLIBS)
.C.o:
	$(COMPILE.cc) $(OUTPUT_OPTION) $<
.c:
	$(LINK.cc) -o $@@ $< $(LDLIBS)
.c.o:
	$(COMPILE.cc) $(OUTPUT_OPTION) $<

ifeq (1,0)
.m4h.h:
	rm -f $@@
	${M4} defines.m4h $< | cat -s > $@@
	chmod a-w $@@

.m4c.c:
	rm -f $@@
	${M4} defines.m4c $< | cat -s > $@@
	chmod a-w $@@
endif

VISIONDIR=/cis/vision/src/iac++

INCDIR=${TOP}/include

EXPDIR=/cis/lightning2/thoth.aux/gcc-bunker
#CCC=${EXPDIR}/g++ -B${EXPDIR}/ -Wall
#CCC=g++ -Wall
#CCC=/local/bin/CC
#CCC=/usr/lang/CC-3.0.2/CC

ifeq (${SYSTEM},CFront)
CCC=/local/bin/CC-3.0.3
else
ifeq (${SYSTEM},GNU)
CCC=/cis/research/iac++/gcc-bunker/bin/g++ -fno-implicit-templates
else
CCC=/bin/false
endif	#GNU
endif	#CFront



ifeq (${SYSTEM},CFront)
CSOURCES=${patsubst %.o,%.c,${LOBJS} ${CLOSUREOBJS}}
else
CSOURCES=${patsubst %.o,%.c,${LOBJS}}
endif	#CFront

INCLUDEFLAGS= -I. -I${INCDIR} ${EXTRAINCLUDES}
CDEBUGFLAGS=-g
CCFLAGS= ${CDEBUGFLAGS} ${INCLUDEFLAGS} ${XTRAFLAGS} ${XTRACCFLAGS}

.PHONY: all clean spotless headers

##
##

# GURK = RCS/%,v
# # there's a bloody comma in the pattern :(
# RCSFILES = ${patsubst ${GURK},%,${wildcard RCS/*,v}}

# checkout: ${RCSFILES}
#
# ${RCSFILES}: %: RCS/%,v
#	co $@@

##
##

headers-force:: ${HEADERS}
	install -m0444 ${HEADERS} ${INCDIR}/

OTHERHEADERS = ${patsubst %,${INCDIR}/%,${HEADERS}}

headers: ${OTHERHEADERS}

ifneq (${OTHERHEADERS},)
${OTHERHEADERS}: ${INCDIR}/%: %
	rm -f $@@
	install -m0444 $< $@@
endif

##
##

WORKLIB = ${TOP}/lib/libiac++.a
ifneq (${LOBJS},)

lobjs: ${LOBJS}

lar: ${LOBJS}
	${AR} rv${ARL} ${WORKLIB} ${LOBJS}
	${RANLIB} ${WORKLIB}
	touch $@@

lib: lar
	touch $@@

endif

LDLIBS = -L${TOP}/lib ${OTHERLIBS} -liac++ \
	-lcomplex -lm

##
## How to generate closures of a library (pre-instantiate all the templates)
##

ifeq (${SYSTEM},CFront)

#
# CFront closure generation
#

CLOSURECC=${CCC} -ptk -ptmlinkmap -ptdclosure
CLOSURELIBS=-lcomplex -lm

closure: ${LOBJS} ${CLOSUREOBJS}
	if [ -d ptrepository ] ; then \
	( ${CLOSURECC} ${CLOSUREARGS} ${CCFLAGS} ${LOBJS} ${CLOSUREOBJS} ${CLOSURELIBS} ) ; \
	rm -f a.out ; \
	if [ ! -z "${BLASTABLE_PTFILES}" ] ; then \
		for i in ${BLASTABLE_PTFILES} nonexistent; do \
			rm -f ptrepository/$$i*.o; \
		done; \
	fi; \
	find ptrepository -name \*.o -print | sort | ${PERL} ${TOP}/bin/add-templobj.perl -${ARL} ${WORKLIB} ; \
	${RANLIB} ${WORKLIB} ; \
	fi
	touch closure

else	#CFront
ifeq (${SYSTEM},GNU)

#
# GNU C++ closure generation
#

INSTDESC=inst.desc
INSTDIR=g++inst

closure:	${LOBJS} ${INSTDESC}
	if [ -f ${INSTDESC} ]; then \
	CCC="${CCC}" ${PERL} ${TOP}/bin/g++-instantiate.perl -repository ${INSTDIR} ${CCFLAGS} ${INSTDESC} && \
	find ${INSTDIR} -name \*.o -print | sort | ${PERL} ${TOP}/bin/add-templobj.perl -${ARL} ${WORKLIB} && \
	${RANLIB} ${WORKLIB} ; \
	fi
	touch closure

else	#GNU

#
# well, no way to make a closure
#

endif	#GNU
endif	#CFront


##
##
##

ifneq (${SIMPLETESTS},)
${SIMPLETESTS}: test%: test%.o lib
	${LINK.cc} -o $@@ $< ${LDLIBS}
endif

testprogs: ${TESTS}

##
##
##

dist:
	cp ${DISTFILES} ${DISTDIR}/src/${SUBDIR}/

clean::
	rm -f ${LOBJS} *.o *~ core

spotless:: clean
	rm -f ${TESTS} lib lar closure *.bak make.log

ifeq (${SYSTEM},CFront)
spotless:: clean
	rm -rf ptrepository linkmap
else	#CFront
ifeq (${SYSTEM},GNU)
spotless:: clean
	rm -rf g++inst
else	#GNU
# do nothing
endif	#GNU
endif	#CFront


depend:
	awk '/^# dependencies/ { exit 0; } {print $0; } END{print "# dependencies";}' < GNUmakefile > GNUmakefile.new
	g++ -MM -I/local/include/CC/ ${INCLUDEFLAGS} ${CSOURCES} >> GNUmakefile.new
	mv GNUmakefile GNUmakefile.bak
	mv GNUmakefile.new GNUmakefile
@


1.11
log
@added improved dependencies.
added -fno-implicit-templates to g++ compiler.
@
text
@d159 2
a160 1
INSTDESC=g++inst.desc
d164 2
a165 2
	CCC="${CCC}" ${PERL} ${TOP}/bin/g++-instantiate.perl ${CCFLAGS} ${INSTDESC}; \
	find g++inst -name \*.o -print | sort | ${PERL} ${TOP}/bin/add-templobj.perl -${ARL} ${WORKLIB} ; \
d202 1
a202 1
	rm -f ${TESTS} lib closure *.bak make.log
@


1.10
log
@Added support for g++ and g++ closures.
@
text
@d50 2
d56 1
a56 1
CCC=/cis/research/iac++/gcc-bunker/bin/g++
d61 8
a68 1
#CCC=/usr/lang/CC-3.0.2/CC
d109 4
a112 1
lib: ${LOBJS}
d116 4
d161 1
a161 1
closure:	${LOBJS}
d218 1
a218 1
	g++ -MM -I/local/include/CC/ ${INCLUDEFLAGS} *.c >> GNUmakefile.new
@


1.9
log
@Added ability to specify libraries for searching during closure, so
you don't have to placebo out complex class library stuff.
@
text
@d11 1
d50 1
d52 7
d110 1
d113 6
d131 18
a148 1
	find ptrepository -name \*.o -print | sort | ${PERL} ../../bin/add-templobj.perl -${ARL} ${WORKLIB} ; \
d153 10
d185 13
a197 2
	rm -f ${TESTS} lib closure *.bak
	rm -rf ptrepository linkmap make.log
@


1.8
log
@*** empty log message ***
@
text
@d103 3
d108 1
a108 1
	( ${CCC} -ptk -ptmlinkmap -ptdclosure ${CLOSUREARGS} ${CCFLAGS} ${LOBJS} ${CLOSUREOBJS} ) ; \
d142 1
a142 1
	rm -f ${TESTS} lib closure
@


1.7
log
@support for screwy systems that don't have enough temp space.
@
text
@d48 2
a49 1
CCC=/local/bin/CC
d52 1
a52 1
INCLUDEFLAGS= -I. -I${INCDIR} -I../../depot/include ${EXTRAINCLUDES}
d97 1
a97 1
LDLIBS = -L${TOP}/lib ${OTHERLIBS} -liac++ ../../depot/lib/libiac++.a \
d112 1
a112 1
	find ptrepository -name \*.o -print | ${PERL} ../../bin/add-templobj.perl -${ARL} ${WORKLIB} ; \
d128 7
a140 2

distfiles:
@


1.6
log
@*** empty log message ***
@
text
@d4 8
a28 1
M4=/local/gnu/m4
a54 3
AR=/usr/bin/ar
RANLIB=/usr/bin/ranlib

d91 1
a91 1
	${AR} rv ${WORKLIB} ${LOBJS}
d111 1
a111 1
	../../bin/add-templobj.perl ${WORKLIB} ptrepository/*.o ; \
d128 1
a128 1
	rm -f ${LOBJS} *.o *~
d132 4
a135 1
	rm -rf ptrepository
@


1.5
log
@support for m4 metafiles.
no more automatic checkout of RCS files.
ranlib is adjustable.
closure is available to all modules now.
dependency generation is more robust.
@
text
@d92 2
a93 1
LDLIBS = -L${TOP}/lib ${OTHERLIBS} -liac++ ../../depot/lib/libiac++.a -lm
d132 1
a132 1
	${EXPDIR}/bin/g++ -MM -I/local/include/CC/ ${INCLUDEFLAGS} *.c >> GNUmakefile.new
@


1.4
log
@new depend target
.c is now considered C++ code
@
text
@d8 1
a8 1
.SUFFIXES: ${SUFFIXES} .C
d21 13
d38 1
a38 1
EXPDIR=/cis/lightning2/thoth.aux/gcc-2.2.2
d42 1
d45 2
a46 1
CCFLAGS= -g ${INCLUDEFLAGS}
d48 2
a49 1
.PHONY: all clean spotless
d51 2
d56 3
a58 3
GURK = RCS/%,v
# there's a bloody comma in the pattern :(
RCSFILES = ${patsubst ${GURK},%,${wildcard RCS/*,v}}
d60 4
a63 1
checkout: ${RCSFILES}
a64 3
${RCSFILES}: %: RCS/%,v
	co $@@

d76 1
a76 1
${OTHERHEADERS}: ${INCDIR}/%.h: %.h
d85 1
d88 1
a88 1
	ranlib ${WORKLIB}
d90 1
d97 18
d126 2
d130 4
a133 2
	awk '{print $0;} /^# dependencies/{print "";exit 0}' < GNUmakefile > GNUmakefile.new
	g++ -MM ${INCLUDEFLAGS} *.c >> GNUmakefile.new
@


1.3
log
@CFrontified
@
text
@d6 2
a7 2
# we will use Sun's target definitions
include make/default.mk
d9 3
d16 4
d30 2
a31 1
CC=gcc
a32 2
CCFLAGS= -g -I. -I${INCDIR} -I../../depot/include ${EXTRAINCLUDES}

d35 15
d63 3
d74 3
d88 4
@


1.2
log
@made it possible to include gnumake.templ without defining HEADERS
@
text
@d8 5
d19 4
a22 2
CCC=${EXPDIR}/g++ -B${EXPDIR}/
#CCC=g++
d24 2
a25 1
CCFLAGS= -g -Wall -I. -I${INCDIR} -I../../depot/include
@


1.1
log
@Initial revision
@
text
@d28 1
d32 1
@
