### definitions # 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 = /opt/gcc-3.2/bin/g++ -R/opt/gcc-3.2/lib ### 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. # standard (non-optimized) compile if suffix is .C .cc: $*.cc $(compiler) $*.cc $(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) erastosthenes0: erastosthenes.cc $(compiler) erastosthenes.cc -o erastosthenes0 erastosthenes1: erastosthenes1.cc $(compiler) erastosthenes1.cc -o erastosthenes1 erastosthenes2: erastosthenes.cc $(compiler) erastosthenes.cc -o erastosthenes2 -O4 erastosthenes3: erastosthenes1.cc $(compiler) erastosthenes1.cc -o erastosthenes3 -O4 run: go erastosthenes0 erastosthenes1 erastosthenes2 erastosthenes3 go clean: rm -f a.out *.o erastosthenes? erastosthenes