From c6e143aba75a305ed8c6c65eb00121229dfca611 Mon Sep 17 00:00:00 2001 From: syntheticpp Date: Sat, 24 Sep 2005 23:08:48 +0000 Subject: [PATCH] add general gcc makefiles git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@257 7ec92016-0320-0410-acc4-a06ded1c099a --- Makefile | 34 +++++++++++++++++++++++++++++++ src/Makefile | 39 ++++++++++++++++++++++++++++++++++++ test/Factory/Makefile | 31 ++++++++++++++++++++++++++++ test/RegressionTest/Makefile | 30 +++++++++++++++++++++++++++ test/SafeFormat/Makefile | 30 +++++++++++++++++++++++++++ test/SmallObj/Makefile | 32 +++++++++++++++++++++++++++++ test/flex_string/Makefile | 31 ++++++++++++++++++++++++++++ 7 files changed, 227 insertions(+) create mode 100755 Makefile create mode 100755 src/Makefile create mode 100755 test/Factory/Makefile create mode 100755 test/RegressionTest/Makefile create mode 100755 test/SafeFormat/Makefile create mode 100755 test/SmallObj/Makefile create mode 100755 test/flex_string/Makefile diff --git a/Makefile b/Makefile new file mode 100755 index 0000000..293e10e --- /dev/null +++ b/Makefile @@ -0,0 +1,34 @@ + +MAKEFILE = Makefile + +SUBTARGETS = \ + sub-src \ + sub-test \ + +all: $(SUBTARGETS) + +sub-src: FORCE + cd src && \ + $(MAKE) -f $(MAKEFILE) + @cd .. + +sub-test: FORCE + cd test && \ + $(MAKE) -f $(MAKEFILE) + @cd .. + + + +clean: + cd src && \ + $(MAKE) -f $(MAKEFILE) clean + @cd .. + cd test && \ + $(MAKE) -f $(MAKEFILE) clean + @cd .. + + + + +FORCE: + diff --git a/src/Makefile b/src/Makefile new file mode 100755 index 0000000..4dc97b9 --- /dev/null +++ b/src/Makefile @@ -0,0 +1,39 @@ + + +CPP = g++ +CC = gcc +OBJ = Singleton.o SmallObj.o +LINKOBJ = Singleton.o SmallObj.o +LIBS = +CXXINCS = -I..\include +BIN = ../lib/libloki.a +CXXFLAGS = $(CXXINCS) -O2 -DNDEBUG +CFLAGS = $(INCS) -g3 +RM = rm -f +CHK_DIR_EXISTS= if not exist +MKDIR = mkdir + +.PHONY: all all-before all-after clean clean-custom + +all: all-before ../lib/libloki.a all-after + + +clean: clean-custom + ${RM} $(OBJ) $(BIN) + +$(BIN): $(LINKOBJ) + ar r $(BIN) $(LINKOBJ) + ranlib $(BIN) + +check_tmp: + @$(CHK_DIR_EXISTS) $(MKDIR) tmp + +check_lib: + @$(CHK_DIR_EXISTS) ..\lib\ $(MKDIR) ..\lib\ + +Singleton.o: Singleton.cpp + $(CPP) -c Singleton.cpp -o Singleton.o $(CXXFLAGS) + +SmallObj.o: SmallObj.cpp + $(CPP) -c SmallObj.cpp -o SmallObj.o $(CXXFLAGS) + diff --git a/test/Factory/Makefile b/test/Factory/Makefile new file mode 100755 index 0000000..27ddba0 --- /dev/null +++ b/test/Factory/Makefile @@ -0,0 +1,31 @@ + + +CPP = g++ +CC = gcc +OBJ = Factory.o +LINKOBJ = Factory.o +CXXINCS = -I./../../include +LIBS = -L../../lib -lloki +CXXFLAGS = $(CXXINCS) -O2 -DNDEBUG +BIN = main-gcc.exe +RM = rm -f +CHK_DIR_EXISTS= if not exist +MKDIR = mkdir + +.PHONY: all all-before all-after clean clean-custom + +all: all-before $(BIN) all-after + + +clean: clean-custom + ${RM} $(OBJ) $(BIN) + +$(BIN): $(OBJ) + $(CPP) $(LINKOBJ) -o main-gcc.exe $(LIBS) + +check_tmp: + @$(CHK_DIR_EXISTS) "" $(MKDIR) "tmp" + +Factory.o: Factory.cpp + $(CPP) -c Factory.cpp -o Factory.o $(CXXFLAGS) + diff --git a/test/RegressionTest/Makefile b/test/RegressionTest/Makefile new file mode 100755 index 0000000..fb9edf3 --- /dev/null +++ b/test/RegressionTest/Makefile @@ -0,0 +1,30 @@ + + +CPP = g++ +CC = gcc +OBJ = Test.o +LINKOBJ = Test.o +CXXINCS = -I./../../include +CXXFLAGS = $(CXXINCS) -O2 -DNDEBUG +BIN = main-gcc.exe +RM = rm -f +CHK_DIR_EXISTS= if not exist +MKDIR = mkdir + +.PHONY: all all-before all-after clean clean-custom + +all: all-before $(BIN) all-after + + +clean: clean-custom + ${RM} $(OBJ) $(BIN) + +$(BIN): $(OBJ) + $(CPP) $(LINKOBJ) -o main-gcc.exe $(LIBS) + +check_tmp: + @$(CHK_DIR_EXISTS) "" $(MKDIR) "tmp" + +Test.o: Test.cpp + $(CPP) -c Test.cpp -o Test.o $(CXXFLAGS) + diff --git a/test/SafeFormat/Makefile b/test/SafeFormat/Makefile new file mode 100755 index 0000000..451386e --- /dev/null +++ b/test/SafeFormat/Makefile @@ -0,0 +1,30 @@ + + +CPP = g++ +CC = gcc +OBJ = main.o +LINKOBJ = main.o +CXXINCS = -I./../../include +CXXFLAGS = $(CXXINCS) -O2 -DNDEBUG +BIN = main-gcc.exe +RM = rm -f +CHK_DIR_EXISTS= if not exist +MKDIR = mkdir + +.PHONY: all all-before all-after clean clean-custom + +all: all-before $(BIN) all-after + + +clean: clean-custom + ${RM} $(OBJ) $(BIN) + +$(BIN): $(OBJ) + $(CPP) $(LINKOBJ) -o main-gcc.exe $(LIBS) + +check_tmp: + @$(CHK_DIR_EXISTS) "" $(MKDIR) "tmp" + +main.o: main.cpp + $(CPP) -c main.cpp -o main.o $(CXXFLAGS) + diff --git a/test/SmallObj/Makefile b/test/SmallObj/Makefile new file mode 100755 index 0000000..43cadaf --- /dev/null +++ b/test/SmallObj/Makefile @@ -0,0 +1,32 @@ + + +CPP = g++ +CC = gcc +OBJ = SmallObjBench.o SmallObj.o +LINKOBJ = SmallObjBench.o SmallObj.o +CXXINCS = -I./../../include -I./../../include/loki +CXXFLAGS = $(CXXINCS) -DNDEBUG -fexpensive-optimizations -O3 +BIN = main-gcc.exe +RM = rm -f +CHK_DIR_EXISTS= if not exist +MKDIR = mkdir + +.PHONY: all all-before all-after clean clean-custom + +all: clean all-before $(BIN) all-after + + +clean: clean-custom + ${RM} $(OBJ) $(BIN) + +$(BIN): $(OBJ) + $(CPP) $(LINKOBJ) -o main-gcc.exe $(LIBS) + +check_tmp: + @$(CHK_DIR_EXISTS) "" $(MKDIR) "tmp" + +SmallObjBench.o: SmallObjBench.cpp + $(CPP) -c SmallObjBench.cpp -o SmallObjBench.o $(CXXFLAGS) + +SmallObj.o: ../../src/SmallObj.cpp + $(CPP) -c ../../src/SmallObj.cpp -o SmallObj.o $(CXXFLAGS) diff --git a/test/flex_string/Makefile b/test/flex_string/Makefile new file mode 100755 index 0000000..e770dce --- /dev/null +++ b/test/flex_string/Makefile @@ -0,0 +1,31 @@ + + +CPP = g++ +CC = gcc +OBJ = main.o +LINKOBJ = main.o +CXXINCS = -I./../../include +CXXFLAGS = $(CXXINCS) -O2 -DNDEBUG +BIN = main-gcc.exe +RM = rm -f +CHK_DIR_EXISTS= if not exist +MKDIR = mkdir + +.PHONY: all all-before all-after clean clean-custom + +all: all-before $(BIN) all-after + + +clean: clean-custom + ${RM} $(OBJ) $(BIN) + +$(BIN): $(OBJ) + $(CPP) $(LINKOBJ) -o main-gcc.exe $(LIBS) + +check_tmp: + @$(CHK_DIR_EXISTS) "" $(MKDIR) "tmp" + + +main.o: main.cpp + $(CPP) -c main.cpp -o main.o $(CXXFLAGS) +