# Makefile for g++ library test files
# Copyright (C) 1988 Free Software Foundation
# written by Doug Lea (dl@rocky.oswego.edu)
# This file is part of GNU CC.
# GNU CC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY. No author or distributor
# accepts responsibility to anyone for the consequences of using it
# or for whether it serves any particular purpose or works at all,
# unless he says so in writing. Refer to the GNU CC General Public
# License for full details.
# Everyone is granted permission to copy, modify and redistribute
# GNU CC, but only under the conditions described in the
# GNU CC General Public License. A copy of this license is
# supposed to have been given to you along with GNU CC so you
# can know your rights and responsibilities. It should be in a
# file named COPYING. Among other things, the copyright notice
# and this notice must be preserved on all copies.
# make parameters -- these should normally be inherited from parent make
# ------ source locations
# source directory for libg++.a
# source include directory
# ------ installation destinations
# ------ You will require write-permission on the destination directories
# ------ in order to `make install'
# executables directory: location to install the genclass class generator
# location to install include file directory
IDIR
= $(prefix)/lib
/g
++-include
# ------- System-dependent defines
# ------- use the second form of each for SystemV (USG)
# not used, but convenient for those who preprocess things while compiling
GXX
= g
++ -DHAVE_VPRINTF
-DHAVE_VSCANF
-DHAVE_SETVBUF
-DHAVE_SETLINEBUF
-DHAVE_GETPAGESIZE
# GNU CC compiler name (needed for some .c files in libg++.a)
LDXX
= $(LIBDIR
)/gcc-ld
-L
$(SRCDIR
)
# crt0+.o location (for dynamic loading tests)
GXXCRT1
=$(LIBDIR
)/crt1
+.o
# ------ Other compilation flags
# ------ modify as you like -- the ones here are sheer overkill
GXX_OPTIMIZATION_FLAGS
= -O
-fstrength-reduce
-felide-constructors
-fschedule-insns
-fdelayed-branch
-fsave-memoized
GCC_OPTIMIZATION_FLAGS
= -O
-fstrength-reduce
-fdelayed-branch
#use this only if you like to look at lots of useless messages
VERBOSITY_FLAGS
= -Wall
-v
GXX_INCLUDE_DIRS
= -I
$(SRCIDIR
)
GCC_INCLUDE_DIRS
= -I
$(prefix)/lib
/gcc-include
-I
/usr
/include -I
$(SRCIDIR
)
# Flags for all C++ compiles
GXXFLAGS
= $(OSFLAG
) $(GXX_INCLUDE_DIRS
) $(DEBUG_FLAGS
) $(GXX_OPTIMIZATION_FLAGS
) $(VERBOSITY_FLAGS
) $(PIPE_AS
)
# Flags for all C compiles
CFLAGS
= $(OSFLAG
) $(GCC_INCLUDE_DIRS
) $(DEBUG_FLAGS
) $(GCC_OPTIMIZATION_FLAGS
) $(VERBOSITY_FLAGS
) $(PIPE_AS
)
GXXLDFLAGS
= $(VERBOSITY_FLAGS
) -L
$(SRCDIR
) -lg
++ -lm
$(OSLDFLAG
)
# these flags tell test0 where ld++ and crt1+.o are
TFLAGS
= -DLDXX
='"$(LDXX)"' -DCRT1X
='"$(GXXCRT1)"'
# Comment out the next line to disable incremental linking test
# g++ files should have extension .cc
PROTODIR
=..
/g
++-include/gen
# The following g++ warnings are expected to appear:
# 2. Several warnings from genclass about classes with only .h, no .cc files
# 3. A few harmless reminder warnings that some classes have no data members.
# 4. Many harmless warnings that arguments to vector-delete are unnecessary
# when deleting arrays of builtin types.
TSRCS
= tFile.
cc tObstack.
cc tString.
cc \
tInteger.
cc tRational.
cc \
tComplex.
cc tBitSet.
cc tBitString.
cc tRandom.
cc tList.
cc tPlex.
cc tLList.
cc \
tVec.
cc tStack.
cc tQueue.
cc tDeque.
cc tPQ.
cc tSet.
cc tBag.
cc \
tMap.
cc tFix.
cc tFix16.
cc tFix24.
cc \
test.hello.
cc test.bye.
cc test.bye2.
cc test.
shell.
cc \
TOUTS
= $(TEST0
) tFile tObstack tString \
tInteger tRational tComplex tBitSet tBitString \
tRandom tFix tFix16 tFix24 tCurses tGetOpt \
tList tPlex tLList tVec tStack tQueue tDeque tPQ tSet \
# files for archived prototype classes
iList.o iSLList.o iDLList.o iVec.o iAVec.o \
iPlex.o iFPlex.o iXPlex.o iRPlex.o iMPlex.o \
iSet.o iBag.o iMap.o iPQ.o \
iXPSet.o iOXPSet.o iSLSet.o iOSLSet.o iBSTSet.o \
iAVLSet.o iSplaySet.o iVHSet.o iVOHSet.o iCHSet.o \
iXPBag.o iOXPBag.o iSLBag.o iOSLBag.o iSplayBag.o \
iVHMap.o iCHMap.o iSplayMap.o iAVLMap.o \
iSplayPQ.o iPHPQ.o iXPPQ.o \
iVQueue.o iStack.o iQueue.o iDeque.o \
tests
: $(SRCDIR
)/libg
++.a
$(GENCLASS
) $(TOUTS
)
test0
) echo
"Must run test0 from tty";; \
tCurses
) echo
"Must run tCurses from tty" ;; \
tGetOpt
) echo
$$i; .
/$$i -abc
-de10
-2000 -h3i
;; \
*) echo
$$i; .
/$$i < $$i.inp
;; \
-$(MAKE
) -s runtests
> my.out
2>&1
-diff
-b expected.out my.out
> checktests.diffs
libtest.a
: $(LHDRS
) $(LOBJS
)
$(AR
) r libtest.a
$(LOBJS
)
test0
: test0.h
test.hello.o
test.bye
test.bye2
test.
shell
$(GXX
) test.hello.o
$(GXXLDFLAGS
) -o test0
test.hello.o
: test0.h
test.hello.
cc
$(GXX
) -c
$(GXXFLAGS
) $(TFLAGS
) test.hello.
cc -o
test.hello.o
test.bye
: test0.h
test.bye.
cc
$(GXX
) -c
$(GXXFLAGS
) $(TFLAGS
) test.bye.
cc -o
test.bye
test.bye2
: test0.h
test.bye2.
cc
$(GXX
) -c
$(GXXFLAGS
) $(TFLAGS
) test.bye2.
cc -o
test.bye2
test.
shell: test0.h
test.
shell.
cc
$(GXX
) -c
$(GXXFLAGS
) $(TFLAGS
) test.
shell.
cc -o
test.
shell
$(GXX
) tFile.o
-o tFile
$(GXXLDFLAGS
)
$(GXX
) tObstack.o
-o tObstack
$(GXXLDFLAGS
)
$(GXX
) tString.o
-o tString
$(GXXLDFLAGS
)
$(GXX
) tInteger.o
-o tInteger
$(GXXLDFLAGS
)
$(GXX
) twrapper.o
-o twrapper
$(GXXLDFLAGS
)
$(GXX
) tgwrapper.o
-o tgwrapper
$(GXXLDFLAGS
)
$(GXX
) tRational.o
-o tRational
$(GXXLDFLAGS
)
$(GXX
) tComplex.o
-o tComplex
$(GXXLDFLAGS
)
$(GXX
) tBitSet.o
-o tBitSet
$(GXXLDFLAGS
)
$(GXX
) tBitString.o
-o tBitString
$(GXXLDFLAGS
)
$(GXX
) tRandom.o
-o tRandom
$(GXXLDFLAGS
)
$(GXX
) tFix.o
-o tFix
$(GXXLDFLAGS
)
$(GXX
) tFix16.o
-o tFix16
$(GXXLDFLAGS
)
$(GXX
) tFix24.o
-o tFix24
$(GXXLDFLAGS
)
$(GXX
) tCurses.o
-o tCurses
-lg
++ -lcurses
-ltermcap
$(GXXLDFLAGS
)
$(GXX
) tGetOpt.o
-o tGetOpt
$(GXXLDFLAGS
)
$(GXX
) tList.o
-o tList
-L.
-ltest
$(GXXLDFLAGS
)
$(GXX
) tPlex.o
-o tPlex
-L.
-ltest
$(GXXLDFLAGS
)
tLList
: libtest.a tLList.o
$(GXX
) tLList.o
-o tLList
-L.
-ltest
$(GXXLDFLAGS
)
$(GXX
) tVec.o
-o tVec
-L.
-ltest
$(GXXLDFLAGS
)
tStack
: libtest.a tStack.o
$(GXX
) tStack.o
-o tStack
-L.
-ltest
$(GXXLDFLAGS
)
tQueue
: libtest.a tQueue.o
$(GXX
) tQueue.o
-o tQueue
-L.
-ltest
$(GXXLDFLAGS
)
tDeque
: libtest.a tDeque.o
$(GXX
) tDeque.o
-o tDeque
-L.
-ltest
$(GXXLDFLAGS
)
$(GXX
) tPQ.o
-o tPQ
-L.
-ltest
$(GXXLDFLAGS
)
$(GXX
) tSet.o
-o tSet
-L.
-ltest
$(GXXLDFLAGS
)
$(GXX
) tBag.o
-o tBag
-L.
-ltest
$(GXXLDFLAGS
)
$(GXX
) tMap.o
-o tMap
-L.
-ltest
$(GXXLDFLAGS
)
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val defs i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val Set i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val XPSet i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val OXPSet i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val SLSet i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val OSLSet i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val BSTSet i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val AVLSet i
iSplaySet.h iSplaySet.
cc :
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val SplaySet i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val VHSet i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val VOHSet i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val CHSet i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val Bag i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val XPBag i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val OXPBag i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val SLBag i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val OSLBag i
iSplayBag.h iSplayBag.
cc :
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val SplayBag i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val VHBag i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val CHBag i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) -2 int val int val Map i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) -2 int val int val VHMap i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) -2 int val int val CHMap i
iSplayMap.h iSplayMap.
cc :
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) -2 int val int val SplayMap i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) -2 int val int val AVLMap i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) -2 int val int val RAVLMap i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val PQ i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val PHPQ i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val SplayPQ i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val XPPQ i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val Stack i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val Queue i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val Deque i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val SLStack i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val SLQueue i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val DLDeque i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val List i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val Plex i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val FPlex i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val XPlex i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val MPlex i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val RPlex i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val FPStack i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val XPStack i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val FPQueue i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val XPQueue i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val XPDeque i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val SLList i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val DLList i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val Vec i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val AVec i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val VStack i
PROTODIR
=$(PROTODIR
); export PROTODIR
; $(GENCLASS
) int val VQueue i
(rm -f
$(TOUTS
); make tests
)
rm -f plot.out ffile streamfile i
*.
cc i
*.h C
++.hack
* my.out checktests.diffs
rm -f
test.bye
test.bye2
test.
shell libtest.a
$(TOUTS
)