### definitions # course stuff DS220home = /home/usra/40/16603/220 DS220include = -I$(DS220home)/include DS220lib = -L$(DS220home)/lib DS220 = $(DS220include) $(DS220lib) # GMP is a system providing arbitrary precision integers, rational numbers, and floats. # We will use the integer part. gmphome = /opt/gmp-4.1.2 gmpinclude = -I$(gmphome)/include gmplib = -L$(gmphome)/lib -R$(gmphome)/lib -lgmp -lgmpxx gmp = $(gmpinclude) $(gmplib) # for some reason, this is needed to get the dynamic linking right. gxx = -R/opt/gcc-3.2/lib # Use g++ because CC has some problems with the C++ standard. compiler = g++ ### compilations ########################### # sample make command for a file with dependencies #foo: foo.cc foo.h bar.o # $(compiler) foo.cc bar.o $(DS220) $(gmp) $(gxx) # generic compilation depending only on .cc file, # using course's and gmp's include/ and lib/ dirs, also using a dynamic linking kludge. .cc: $*.cc $(compiler) $*.cc $(DS220) $(gmp) $(gxx) -o $* # generic component .o build, depending only on .cc file, # using course's and gmp's include/ dirs. Compilation only: no need for lib/ dirs. .cc.o: $*.cc $(compiler) $*.cc -c $(DS220include) $(gmpinclude) clean: rm -f a.out *.o basicwordcount wordcount wordfreq integer