add general gcc makefiles
git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@257 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
parent
4043617da0
commit
c6e143aba7
7 changed files with 227 additions and 0 deletions
34
Makefile
Executable file
34
Makefile
Executable file
|
@ -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:
|
||||
|
39
src/Makefile
Executable file
39
src/Makefile
Executable file
|
@ -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)
|
||||
|
31
test/Factory/Makefile
Executable file
31
test/Factory/Makefile
Executable file
|
@ -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)
|
||||
|
30
test/RegressionTest/Makefile
Executable file
30
test/RegressionTest/Makefile
Executable file
|
@ -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)
|
||||
|
30
test/SafeFormat/Makefile
Executable file
30
test/SafeFormat/Makefile
Executable file
|
@ -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)
|
||||
|
32
test/SmallObj/Makefile
Executable file
32
test/SmallObj/Makefile
Executable file
|
@ -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)
|
31
test/flex_string/Makefile
Executable file
31
test/flex_string/Makefile
Executable file
|
@ -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)
|
||||
|
Loading…
Reference in a new issue