- Create initial 0.1.6 changelog

- Makefiles can now be called from sub directories
- Makefiles know includes and recompile if they are changed (linux, macosx)
- Build all tests except SingletonDll with the static library (linux, macosx)


git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@695 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
lfittl 2006-07-14 07:31:37 +00:00
parent 81c7b0d3db
commit 3de4a064cb
25 changed files with 244 additions and 135 deletions

View file

@ -1,12 +1,16 @@
BIN = DeletableSingleton$(BIN_SUFFIX)
SRC = DeletableSingleton.cpp
OBJ = $(SRC:.cpp=.o)
include ../Makefile.common
BIN := DeletableSingleton$(BIN_SUFFIX)
SRC := DeletableSingleton.cpp
OBJ := $(SRC:.cpp=.o)
.PHONY: all clean
all: $(BIN)
clean:
clean: cleandeps
$(RM) $(BIN)
$(RM) $(OBJ)
$(BIN): $(OBJ)
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
include ../../Makefile.deps

View file

@ -1,12 +1,16 @@
BIN = Factory$(BIN_SUFFIX)
SRC = Factory.cpp
OBJ = $(SRC:.cpp=.o)
include ../Makefile.common
BIN := Factory$(BIN_SUFFIX)
SRC := Factory.cpp
OBJ := $(SRC:.cpp=.o)
.PHONY: all clean
all: $(BIN)
clean:
clean: cleandeps
$(RM) $(BIN)
$(RM) $(OBJ)
$(BIN): $(OBJ)
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
include ../../Makefile.deps

View file

@ -1,12 +1,16 @@
BIN = FunctionTest$(BIN_SUFFIX)
SRC = FunctionTest.cpp
OBJ = $(SRC:.cpp=.o)
include ../Makefile.common
BIN := FunctionTest$(BIN_SUFFIX)
SRC := FunctionTest.cpp
OBJ := $(SRC:.cpp=.o)
.PHONY: all clean
all: $(BIN)
clean:
clean: cleandeps
$(RM) $(BIN)
$(RM) $(OBJ)
$(BIN): $(OBJ)
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
include ../../Makefile.deps

View file

@ -1,12 +1,17 @@
BIN = main$(BIN_SUFFIX)
SRC = main.cpp
OBJ = $(SRC:.cpp=.o)
include ../Makefile.common
BIN := main$(BIN_SUFFIX)
SRC := main.cpp
OBJ := $(SRC:.cpp=.o)
LDLIBS += -lpthread
.PHONY: all clean
all: $(BIN)
clean:
clean: cleandeps
$(RM) $(BIN)
$(RM) $(OBJ)
$(BIN): $(OBJ)
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
include ../../Makefile.deps

View file

@ -1,14 +1,16 @@
BIN1 = main$(BIN_SUFFIX)
SRC1 = main.cpp
OBJ1 = $(SRC1:.cpp=.o)
BIN2 = main2$(BIN_SUFFIX)
SRC2 = main2.cpp
OBJ2 = $(SRC2:.cpp=.o)
override CXXFLAGS = $(CXXWARNFLAGS) -g -fexpensive-optimizations -O3
include ../Makefile.common
BIN1 := main$(BIN_SUFFIX)
SRC1 := main.cpp
OBJ1 := $(SRC1:.cpp=.o)
BIN2 := main2$(BIN_SUFFIX)
SRC2 := main2.cpp
OBJ2 := $(SRC2:.cpp=.o)
CXXFLAGS := $(CXXWARNFLAGS) -g -fexpensive-optimizations -O3
.PHONY: all clean
all: $(BIN1) $(BIN2)
clean:
clean: cleandeps
$(RM) $(BIN1)
$(RM) $(OBJ1)
$(RM) $(BIN2)
@ -19,3 +21,5 @@ $(BIN1): $(OBJ1)
$(BIN2): $(OBJ2)
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
include ../../Makefile.deps

View file

@ -1,13 +1,3 @@
export CPPFLAGS = -I../../include -DNDEBUG
export LDFLAGS = -L../../lib
export LDLIBS = -lloki
ifeq ($(OS),Windows)
export BIN_SUFFIX = .exe
else
export BIN_SUFFIX =
endif
SUBTARGETS_ORIG := $(patsubst %/,%,$(dir $(wildcard */Makefile)))
SUBTARGETS := $(filter-out $(SUBTARGETS_FILTER_OUT),$(SUBTARGETS_ORIG))

11
test/Makefile.common Normal file
View file

@ -0,0 +1,11 @@
include ../../Makefile.common
override CPPFLAGS += -I../../include -DNDEBUG
override LDFLAGS += -L../../lib -static
LDLIBS := -lloki
ifeq ($(OS),Windows)
BIN_SUFFIX := .exe
else
BIN_SUFFIX :=
endif

View file

@ -1,12 +1,16 @@
BIN = main$(BIN_SUFFIX)
SRC = main.cpp
OBJ = $(SRC:.cpp=.o)
include ../Makefile.common
BIN := main$(BIN_SUFFIX)
SRC := main.cpp
OBJ := $(SRC:.cpp=.o)
.PHONY: all clean
all: $(BIN)
clean:
clean: cleandeps
$(RM) $(BIN)
$(RM) $(OBJ)
$(BIN): $(OBJ)
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
include ../../Makefile.deps

View file

@ -1,12 +1,16 @@
BIN = main$(BIN_SUFFIX)
SRC = main.cpp
OBJ = $(SRC:.cpp=.o)
include ../Makefile.common
BIN := main$(BIN_SUFFIX)
SRC := main.cpp
OBJ := $(SRC:.cpp=.o)
.PHONY: all clean
all: $(BIN)
clean:
clean: cleandeps
$(RM) $(BIN)
$(RM) $(OBJ)
$(BIN): $(OBJ)
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
include ../../Makefile.deps

View file

@ -1,10 +1,12 @@
BIN1 = main$(BIN_SUFFIX)
SRC1 = main.cpp
OBJ1 = $(SRC1:.cpp=.o)
LIB1 = libfoo.a
SRC2 = foo.cpp
OBJ2 = $(SRC2:.cpp=.o)
override CPPFLAGS += -DLOKI_FUNCTOR_IS_NOT_A_SMALLOBJECT
include ../Makefile.common
BIN1 := main$(BIN_SUFFIX)
SRC1 := main.cpp
OBJ1 := $(SRC1:.cpp=.o)
LIB1 := libfoo.a
SRC2 := foo.cpp
OBJ2 := $(SRC2:.cpp=.o)
CPPFLAGS += -DLOKI_FUNCTOR_IS_NOT_A_SMALLOBJECT
.PHONY: all clean
all: $(BIN1)
@ -15,8 +17,10 @@ $(BIN1): $(OBJ1) $(LIB1)
$(LIB1): $(OBJ2)
$(AR) $(ARFLAGS) $@ $^
clean:
clean: cleandeps
$(RM) $(BIN1)
$(RM) $(OBJ1)
$(RM) $(LIB1)
$(RM) $(OBJ2)
include ../../Makefile.deps

View file

@ -1,12 +1,16 @@
BIN = Test$(BIN_SUFFIX)
SRC = Test.cpp
OBJ = $(SRC:.cpp=.o)
include ../Makefile.common
BIN := Test$(BIN_SUFFIX)
SRC := Test.cpp
OBJ := $(SRC:.cpp=.o)
.PHONY: all clean
all: $(BIN)
clean:
clean: cleandeps
$(RM) $(BIN)
$(RM) $(OBJ)
$(BIN): $(OBJ)
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
include ../../Makefile.deps

View file

@ -1,13 +1,17 @@
BIN = main$(BIN_SUFFIX)
SRC = main.cpp
OBJ = $(SRC:.cpp=.o)
override CXXFLAGS = $(CXXWARNFLAGS) -g -fexpensive-optimizations -O3
include ../Makefile.common
BIN := main$(BIN_SUFFIX)
SRC := main.cpp
OBJ := $(SRC:.cpp=.o)
CXXFLAGS := $(CXXWARNFLAGS) -g -fexpensive-optimizations -O3
.PHONY: all clean
all: $(BIN)
clean:
clean: cleandeps
$(RM) $(BIN)
$(RM) $(OBJ)
$(BIN): $(OBJ)
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
include ../../Makefile.deps

View file

@ -1,12 +1,16 @@
BIN = main$(BIN_SUFFIX)
SRC = main.cpp
OBJ = $(SRC:.cpp=.o)
include ../Makefile.common
BIN := main$(BIN_SUFFIX)
SRC := main.cpp
OBJ := $(SRC:.cpp=.o)
.PHONY: all clean
all: $(BIN)
clean:
clean: cleandeps
$(RM) $(BIN)
$(RM) $(OBJ)
$(BIN): $(OBJ)
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
include ../../Makefile.deps

View file

@ -1,13 +1,15 @@
BIN1 = Dependencies$(BIN_SUFFIX)
SRC1 = Dependencies.cpp
OBJ1 = $(SRC1:.cpp=.o)
BIN2 = Phoenix$(BIN_SUFFIX)
SRC2 = Phoenix.cpp
OBJ2 = $(SRC2:.cpp=.o)
include ../Makefile.common
BIN1 := Dependencies$(BIN_SUFFIX)
SRC1 := Dependencies.cpp
OBJ1 := $(SRC1:.cpp=.o)
BIN2 := Phoenix$(BIN_SUFFIX)
SRC2 := Phoenix.cpp
OBJ2 := $(SRC2:.cpp=.o)
.PHONY: all clean
all: $(BIN1) $(BIN2)
clean:
clean: cleandeps
$(RM) $(BIN1)
$(RM) $(OBJ1)
$(RM) $(BIN2)
@ -18,3 +20,5 @@ $(BIN1): $(OBJ1)
$(BIN2): $(OBJ2)
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
include ../../Makefile.deps

View file

@ -1,26 +1,29 @@
include ../Makefile.common
ifeq ($(OS),Darwin)
LIB1 = libfoo.dylib
LIB2 = libsingletondll.dylib
SHARED_LIB_FLAG = -dynamiclib
LIB1 := libfoo.dylib
LIB2 := libsingletondll.dylib
SHARED_LIB_FLAG := -dynamiclib
else
ifeq ($(OS),Linux)
LIB1 = libfoo.so
LIB2 = libsingletondll.so
SHARED_LIB_FLAG = --shared
LIB1 := libfoo.so
LIB2 := libsingletondll.so
SHARED_LIB_FLAG := --shared
else
LIB1 = foo.dll
LIB2 = singletondll.dll
SHARED_LIB_FLAG = --shared
LIB1 := foo.dll
LIB2 := singletondll.dll
SHARED_LIB_FLAG := --shared
endif
endif
BIN1 = client$(BIN_SUFFIX)
SRC1 = client.cpp
OBJ1 = $(SRC1:.cpp=.o)
SRC2 = foo.cpp
OBJ2 = $(SRC2:.cpp=.o)
SRC3 = singletondll.cpp
OBJ3 = $(SRC3:.cpp=.o)
BIN1 := client$(BIN_SUFFIX)
SRC1 := client.cpp
OBJ1 := $(SRC1:.cpp=.o)
SRC2 := foo.cpp
OBJ2 := $(SRC2:.cpp=.o)
SRC3 := singletondll.cpp
OBJ3 := $(SRC3:.cpp=.o)
override LDFLAGS := -L../../lib
.PHONY: all clean
all: $(BIN1)
@ -34,10 +37,12 @@ $(LIB1): $(OBJ2)
$(LIB2): $(OBJ3)
$(CXX) $(SHARED_LIB_FLAG) $(LDFLAGS) -L. -o $@ $^ -lfoo $(LDLIBS)
clean:
clean: cleandeps
$(RM) $(BIN1)
$(RM) $(OBJ1)
$(RM) $(LIB1)
$(RM) $(OBJ2)
$(RM) $(LIB2)
$(RM) $(OBJ3)
include ../../Makefile.deps

View file

@ -1,14 +1,16 @@
BIN1 = SmallObjBench$(BIN_SUFFIX)
SRC1 = SmallObjBench.cpp
OBJ1 = $(SRC1:.cpp=.o)
BIN2 = SmallObjSingleton$(BIN_SUFFIX)
SRC2 = SmallObjSingleton.cpp
OBJ2 = $(SRC2:.cpp=.o)
override CXXFLAGS = $(CXXWARNFLAGS) -g -fexpensive-optimizations -O3
include ../Makefile.common
BIN1 := SmallObjBench$(BIN_SUFFIX)
SRC1 := SmallObjBench.cpp
OBJ1 := $(SRC1:.cpp=.o)
BIN2 := SmallObjSingleton$(BIN_SUFFIX)
SRC2 := SmallObjSingleton.cpp
OBJ2 := $(SRC2:.cpp=.o)
CXXFLAGS := $(CXXWARNFLAGS) -g -fexpensive-optimizations -O3
.PHONY: all clean
all: $(BIN1) $(BIN2)
clean:
clean: cleandeps
$(RM) $(BIN1)
$(RM) $(OBJ1)
$(RM) $(BIN2)
@ -19,3 +21,5 @@ $(BIN1): $(OBJ1)
$(BIN2): $(OBJ2)
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
include ../../Makefile.deps

View file

@ -1,12 +1,17 @@
BIN = main$(BIN_SUFFIX)
SRC = main.cpp strong.cpp LockTest.cpp
OBJ = $(SRC:.cpp=.o)
include ../Makefile.common
BIN := main$(BIN_SUFFIX)
SRC := main.cpp strong.cpp LockTest.cpp
OBJ := $(SRC:.cpp=.o)
LDLIBS += -lpthread
.PHONY: all clean
all: $(BIN)
clean:
clean: cleandeps
$(RM) $(BIN)
$(RM) $(OBJ)
$(BIN): $(OBJ)
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
include ../../Makefile.deps

View file

@ -1,12 +1,16 @@
BIN = main$(BIN_SUFFIX)
SRC = main.cpp
OBJ = $(SRC:.cpp=.o)
include ../Makefile.common
BIN := main$(BIN_SUFFIX)
SRC := main.cpp
OBJ := $(SRC:.cpp=.o)
.PHONY: all clean
all: $(BIN)
clean:
clean: cleandeps
$(RM) $(BIN)
$(RM) $(OBJ)
$(BIN): $(OBJ)
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
include ../../Makefile.deps

View file

@ -1,14 +1,16 @@
BIN = main$(BIN_SUFFIX)
SRC = main.cpp
OBJ = $(SRC:.cpp=.o)
override LDFLAGS =
override LDLIBS =
include ../Makefile.common
BIN := main$(BIN_SUFFIX)
SRC := main.cpp
OBJ := $(SRC:.cpp=.o)
.PHONY: all clean
all: $(BIN)
clean:
clean: cleandeps
$(RM) $(BIN)
$(RM) $(OBJ)
$(BIN): $(OBJ)
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
include ../../Makefile.deps