From dc758a4854faa84c368191f0e3e31b837a58f227 Mon Sep 17 00:00:00 2001 From: evomarc Date: Wed, 23 Oct 2002 04:42:07 +0000 Subject: [PATCH] Modification of all Makefiles so that it compiles smoothly on Solaris. Thanks to Oliver Koenig --- eo/tutorial/Lesson1/Makefile | 4 ++-- eo/tutorial/Lesson2/Makefile | 4 ++-- eo/tutorial/Lesson3/Makefile | 4 ++-- eo/tutorial/Lesson4/Makefile | 11 ++++++----- eo/tutorial/Templates/Makefile.tmpl | 13 ++++++++----- 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/eo/tutorial/Lesson1/Makefile b/eo/tutorial/Lesson1/Makefile index 0e52a708..093ca852 100644 --- a/eo/tutorial/Lesson1/Makefile +++ b/eo/tutorial/Lesson1/Makefile @@ -9,9 +9,9 @@ DIR_EO = ../../src # and have problems with the interpretation of the output (and its colors) # then you should use c++ instead (make CXX=c++ will do) -.cpp: ; $(CXX) -DPACKAGE=\"eo\" -DVERSION=\"0.9.3\" -I. -I../../src -Wall -g -pg -o $@ $*.cpp ../../src/libeo.a ../../src/utils/libeoutils.a +.cpp: ; $(CXX) -DPACKAGE=\"eo\" -DVERSION=\"0.9.3\" -I. -I$(DIR_EO) -Wall -g -pg -o $@ $*.cpp $(DIR_EO)/utils/libeoutils.a $(DIR_EO)/libeo.a -.cpp.o: ; $(CXX) -DPACKAGE=\"eo\" -DVERSION=\"0.9.3\" -I. -I../../src -Wall -g -c -pg $*.cpp +.cpp.o: ; $(CXX) -DPACKAGE=\"eo\" -DVERSION=\"0.9.3\" -I. -I$(DIR_EO) -Wall -g -c -pg $*.cpp firstGA = FirstRealGA FirstBitGA diff --git a/eo/tutorial/Lesson2/Makefile b/eo/tutorial/Lesson2/Makefile index c57597f9..1aec1710 100644 --- a/eo/tutorial/Lesson2/Makefile +++ b/eo/tutorial/Lesson2/Makefile @@ -14,9 +14,9 @@ DIR_EO = ../../src # and have problems with the interpretation of the output (and its colors) # then you should use c++ instead (make CXX=c++ will do) -.cpp: ; $(CXX) -DPACKAGE=\"eo\" -DVERSION=\"0.9.3\" -I. -I../../src -Wall -g -pg -o $@ $*.cpp ../../src/libeo.a ../../src/utils/libeoutils.a +.cpp: ; $(CXX) -DPACKAGE=\"eo\" -DVERSION=\"0.9.3\" -I. -I$(DIR_EO) -Wall -g -pg -o $@ $*.cpp $(DIR_EO)/utils/libeoutils.a $(DIR_EO)/libeo.a -.cpp.o: ; $(CXX) -DPACKAGE=\"eo\" -DVERSION=\"0.9.3\" -I. -I../../src -Wall -g -c -pg $*.cpp +.cpp.o: ; $(CXX) -DPACKAGE=\"eo\" -DVERSION=\"0.9.3\" -I. -I$(DIR_EO) -Wall -g -c -pg $*.cpp firstEA = FirstRealEA FirstBitEA diff --git a/eo/tutorial/Lesson3/Makefile b/eo/tutorial/Lesson3/Makefile index 0a2f8f66..186791f2 100644 --- a/eo/tutorial/Lesson3/Makefile +++ b/eo/tutorial/Lesson3/Makefile @@ -14,9 +14,9 @@ DIR_EO = ../../src # and have problems with the interpretation of the output (and its colors) # then you should use c++ instead (make CXX=c++ will do) -.cpp: ; $(CXX) -DPACKAGE=\"eo\" -DVERSION=\"0.9.3\" -I. -I../../src -Wall -g -pg -o $@ $*.cpp ../../src/libeo.a ../../src/utils/libeoutils.a +.cpp: ; $(CXX) -DPACKAGE=\"eo\" -DVERSION=\"0.9.3\" -I. -I$(DIR_EO) -Wall -g -pg -o $@ $*.cpp $(DIR_EO)/utils/libeoutils.a $(DIR_EO)/libeo.a -.cpp.o: ; $(CXX) -DPACKAGE=\"eo\" -DVERSION=\"0.9.3\" -I. -I../../src -Wall -g -c -pg $*.cpp +.cpp.o: ; $(CXX) -DPACKAGE=\"eo\" -DVERSION=\"0.9.3\" -I. -I$(DIR_EO) -Wall -g -c -pg $*.cpp secondEA = SecondBitEA SecondRealEA diff --git a/eo/tutorial/Lesson4/Makefile b/eo/tutorial/Lesson4/Makefile index b0402ed6..807d8e12 100644 --- a/eo/tutorial/Lesson4/Makefile +++ b/eo/tutorial/Lesson4/Makefile @@ -14,9 +14,9 @@ DIR_EO = ../../src # and have problems with the interpretation of the output (and its colors) # then you should use c++ instead (make CXX=c++ will do) -.cpp: ; $(CXX) -DPACKAGE=\"eo\" -DVERSION=\"0.9.3\" -I. -I../../src -Wall -g -pg -o $@ $*.cpp ../../src/libeo.a ../../src/utils/libeoutils.a +.cpp: ; $(CXX) -DPACKAGE=\"eo\" -DVERSION=\"0.9.3\" -I. -I$(DIR_EO) -Wall -g -o $@ $*.cpp $(DIR_EO)/utils/libeoutils.a $(DIR_EO)/libeo.a -.cpp.o: ; $(CXX) -DPACKAGE=\"eo\" -DVERSION=\"0.9.3\" -I. -I../../src -Wall -g -c -pg $*.cpp +.cpp.o: ; $(CXX) -DPACKAGE=\"eo\" -DVERSION=\"0.9.3\" -I. -I$(DIR_EO) -Wall -g -c $*.cpp ALL = BitEA RealEA ESEA @@ -24,11 +24,12 @@ lesson3 : $(ALL) all : $(ALL) -BitEA : BitEA.o ; c++ -DPACKAGE=\"eo\" -DVERSION=\"0.9.2\" -Wall -g -o $@ $< ../../src/ga/libga.a ../../src/utils/libeoutils.a ../../src/libeo.a +BitEA : BitEA.o ; + $(CXX) -DPACKAGE=\"eo\" -DVERSION=\"0.9.2\" -Wall -g -o $@ $< $(DIR_EO)/ga/libga.a $(DIR_EO)/utils/libeoutils.a $(DIR_EO)/libeo.a -RealEA : RealEA.o ; c++ -DPACKAGE=\"eo\" -DVERSION=\"0.9.2\" -Wall -g -o $@ $< ../../src/es/libes.a ../../src/utils/libeoutils.a ../../src/libeo.a +RealEA : RealEA.o ; $(CXX) -DPACKAGE=\"eo\" -DVERSION=\"0.9.2\" -Wall -g -o $@ $< $(DIR_EO)/es/libes.a $(DIR_EO)/utils/libeoutils.a $(DIR_EO)/libeo.a -ESEA : ESEA.o ; c++ -DPACKAGE=\"eo\" -DVERSION=\"0.9.2\" -Wall -g -o $@ $< ../../src/es/libes.a ../../src/utils/libeoutils.a ../../src/libeo.a +ESEA : ESEA.o ; $(CXX) -DPACKAGE=\"eo\" -DVERSION=\"0.9.2\" -Wall -g -o $@ $< $(DIR_EO)/es/libes.a $(DIR_EO)/utils/libeoutils.a $(DIR_EO)/libeo.a clean : @/bin/rm $(ALL) *.o *.sav *.xg *.status *~ diff --git a/eo/tutorial/Templates/Makefile.tmpl b/eo/tutorial/Templates/Makefile.tmpl index 3f1a90a2..722a78dc 100644 --- a/eo/tutorial/Templates/Makefile.tmpl +++ b/eo/tutorial/Templates/Makefile.tmpl @@ -3,11 +3,15 @@ # START eventually modify the name of EO dir DIR_EO = ../../src # END eventually modify the name of EO dir + +# eo libs LIB_EO = $(DIR_EO)/utils/libeoutils.a $(DIR_EO)/libeo.a -.cpp: ; c++ -DPACKAGE=\"eo\" -DVERSION=\"0.9.3\" -I. -I$(DIR_EO) -Wall -g -o $@ $*.cpp $(LIB_EO) +# implicit compile rules +.SUFFIXES: .cpp +.cpp: ; $(CXX) -DPACKAGE=\"eo\" -DVERSION=\"0.9.3\" -I. -I$(DIR_EO) -Wall -g -o $@ $*.cpp $(LIB_EO) -.cpp.o: ; c++ -DPACKAGE=\"eo\" -DVERSION=\"0.9.3\" -I. -I$(DIR_EO) -Wall -g -c $*.cpp +.cpp.o: ; $(CXX) -DPACKAGE=\"eo\" -DVERSION=\"0.9.3\" -I. -I$(DIR_EO) -Wall -g -c $*.cpp # local sources COMMON_SOURCES = eoMyStruct.h \ @@ -22,16 +26,15 @@ NO_LIB_SOURCES = MyStructEA.cpp LIB_SOURCES = MyStructLibEA.cpp make_MyStruct.cpp - SOURCES = $(COMMON_SOURCES) MyStructEA.cpp MyStructLibEA.cpp make_MyStruct.cpp ALL = MyStructEA MyStructLibEA MyStructEA : MyStructEA.cpp - c++ -I. -I$(DIR_EO) -g -o $@ MyStructEA.cpp $(LIB_EO) -lm + $(CXX) -I. -I$(DIR_EO) -g -o $@ MyStructEA.cpp $(LIB_EO) -lm MyStructLibEA : MyStructLibEA.o make_MyStruct.o - c++ -g -o $@ MyStructLibEA.o make_MyStruct.o $(LIB_EO) -lm + $(CXX) -g -o $@ MyStructLibEA.o make_MyStruct.o $(LIB_EO) -lm tar : ; tar czvf MyStruct.tgz *.h *.cpp Makefile