# A makefile for the stuff now in libg++/etc/ADT-examples
# ------ source locations
# source directory for libg++.a
# source include directory
SRCIDIR
= ..
/..
/..
/g
++-include
# ------ 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
# GNU CC compiler name (needed for some .c files in libg++.a)
LDXX
= $(LIBDIR
)/gcc-ld
++
# 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
= -L
$(SRCDIR
) -lg
++ -lm
$(OSLDFLAG
)
# these flags tell test0 where ld++ and crt1+.o are
TFLAGS
= -DLDXX
=\"$(LDXX
)\" -DCRT1X
=\"$(GXXCRT1
)\"
# g++ files should have extension .cc
TEST_PROGS
= generic-q search keyhash \
tsort tsortinp genkey patricia kmp
-.
/generic-q
< .
/generic-q.
cc
-.
/keyhash
< .
/keyhash.
cc
-.
/genkey
1000 200 > input
-.
/patricia .
/input .
/input | grep
-v
"is found"
$(GXX
) generic-q.o
$(GXXLDFLAGS
) -o generic-q
$(GXX
) tsort.o
$(GXXLDFLAGS
) -o tsort
$(GXX
) tsortinp.o
$(GXXLDFLAGS
) -o tsortinp
$(GXX
) keyhash.o
$(GXXLDFLAGS
) -o keyhash
$(GXX
) search.o
$(GXXLDFLAGS
) -o search
$(GXX
) genPatkey.o
$(GXXLDFLAGS
) -o genkey
patricia
: Patmain.o Patricia.o
$(GXX
) Patmain.o Patricia.o
$(GXXLDFLAGS
) -o patricia
$(GXX
) kmp.o
$(GXXLDFLAGS
) -o kmp