- 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:
parent
81c7b0d3db
commit
3de4a064cb
25 changed files with 244 additions and 135 deletions
6
CHANGES
6
CHANGES
|
@ -1,5 +1,11 @@
|
||||||
_____________________________________
|
_____________________________________
|
||||||
|
|
||||||
|
Version 0.1.6
|
||||||
|
???, 2006
|
||||||
|
_____________________________________
|
||||||
|
|
||||||
|
_____________________________________
|
||||||
|
|
||||||
Version 0.1.5
|
Version 0.1.5
|
||||||
June 19, 2006
|
June 19, 2006
|
||||||
_____________________________________
|
_____________________________________
|
||||||
|
|
10
Makefile
10
Makefile
|
@ -1,8 +1,4 @@
|
||||||
export VERSION = 0.1.5
|
include Makefile.common
|
||||||
export OS ?= $(shell uname -s)
|
|
||||||
|
|
||||||
export CXXWARNFLAGS = -Wall -Wold-style-cast -Wundef -Wsign-compare -Wconversion -Wpointer-arith -pedantic
|
|
||||||
export CXXFLAGS = $(CXXWARNFLAGS) -g -O2
|
|
||||||
|
|
||||||
.PHONY: all build-static build-shared check clean distclean
|
.PHONY: all build-static build-shared check clean distclean
|
||||||
all: build-static build-shared check
|
all: build-static build-shared check
|
||||||
|
@ -12,7 +8,7 @@ build-static:
|
||||||
build-shared:
|
build-shared:
|
||||||
$(MAKE) -C src build-shared
|
$(MAKE) -C src build-shared
|
||||||
|
|
||||||
check: build-shared
|
check: build-static build-shared
|
||||||
$(MAKE) -C test
|
$(MAKE) -C test
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
@ -23,8 +19,6 @@ distclean: clean
|
||||||
$(MAKE) -C src distclean
|
$(MAKE) -C src distclean
|
||||||
|
|
||||||
ifneq ($(OS),Windows)
|
ifneq ($(OS),Windows)
|
||||||
export prefix ?= /usr
|
|
||||||
|
|
||||||
.PHONY: install install-static
|
.PHONY: install install-static
|
||||||
install:
|
install:
|
||||||
$(MAKE) -C src install-static
|
$(MAKE) -C src install-static
|
||||||
|
|
7
Makefile.common
Normal file
7
Makefile.common
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
VERSION := 0.1.6
|
||||||
|
OS ?= $(shell uname -s)
|
||||||
|
|
||||||
|
CXXWARNFLAGS := -Wall -Wold-style-cast -Wundef -Wsign-compare -Wconversion -Wpointer-arith -pedantic
|
||||||
|
CXXFLAGS := $(CXXWARNFLAGS) -g -O2
|
||||||
|
|
||||||
|
prefix := /usr
|
26
Makefile.deps
Normal file
26
Makefile.deps
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
.PHONY: cleandeps
|
||||||
|
|
||||||
|
ifneq ($(OS),Windows)
|
||||||
|
|
||||||
|
.static-dep/%.dep: %.cpp
|
||||||
|
@mkdir -p $(dir $@)
|
||||||
|
$(CXX) -MM -MT $(patsubst %.cpp,%.o,$<) $(CPPFLAGS) $< > $@
|
||||||
|
|
||||||
|
.shared-dep/%.dep: %.cpp
|
||||||
|
@mkdir -p $(dir $@)
|
||||||
|
$(CXX) -MM -MT $(patsubst %.cpp,%.lo,$<) $(CPPFLAGS) $< > $@
|
||||||
|
|
||||||
|
ifneq ($(MAKECMDGOALS),clean)
|
||||||
|
ifneq ($(MAKECMDGOALS),distclean)
|
||||||
|
-include $(addprefix .static-dep/,$(SRC:.cpp=.dep))
|
||||||
|
-include $(addprefix .shared-dep/,$(SRC:.cpp=.dep))
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
cleandeps:
|
||||||
|
$(RM) -R .static-dep
|
||||||
|
$(RM) -R .shared-dep
|
||||||
|
|
||||||
|
else
|
||||||
|
cleandeps:
|
||||||
|
endif
|
|
@ -1,3 +1,5 @@
|
||||||
|
include ../Makefile.common
|
||||||
|
|
||||||
.PHONY: install
|
.PHONY: install
|
||||||
install:
|
install:
|
||||||
mkdir -p $(prefix)/include/loki
|
mkdir -p $(prefix)/include/loki
|
||||||
|
|
40
src/Makefile
40
src/Makefile
|
@ -1,29 +1,31 @@
|
||||||
SRC = $(wildcard *.cpp)
|
include ../Makefile.common
|
||||||
STATIC_OBJ = $(SRC:.cpp=.o)
|
|
||||||
SHARED_OBJ = $(SRC:.cpp=.lo)
|
SRC := $(wildcard *.cpp)
|
||||||
|
STATIC_OBJ := $(SRC:.cpp=.o)
|
||||||
|
SHARED_OBJ := $(SRC:.cpp=.lo)
|
||||||
|
|
||||||
override CPPFLAGS += -I../include -DNDEBUG
|
override CPPFLAGS += -I../include -DNDEBUG
|
||||||
|
|
||||||
STATIC_LIB = libloki.a
|
STATIC_LIB := libloki.a
|
||||||
|
|
||||||
ifeq ($(OS), Darwin)
|
ifeq ($(OS), Darwin)
|
||||||
SHARED_LIB_BASE = libloki.dylib
|
SHARED_LIB_BASE := libloki.dylib
|
||||||
SHARED_LIB_VERSIONED = libloki.$(VERSION).dylib
|
SHARED_LIB_VERSIONED := libloki.$(VERSION).dylib
|
||||||
override LDFLAGS += -dynamiclib -single_module -install_name $(SHARED_LIB_VERSIONED) -fPIC
|
override LDFLAGS += -dynamiclib -single_module -install_name $(SHARED_LIB_VERSIONED) -fPIC
|
||||||
LDLIBS = -lpthread
|
LDLIBS := -lpthread
|
||||||
RESULT_DIR = ../lib/
|
RESULT_DIR := ../lib/
|
||||||
else
|
else
|
||||||
ifeq ($(OS), Linux)
|
ifeq ($(OS), Linux)
|
||||||
SHARED_LIB_BASE = libloki.so
|
SHARED_LIB_BASE := libloki.so
|
||||||
SHARED_LIB_VERSIONED = libloki.so.$(VERSION)
|
SHARED_LIB_VERSIONED := libloki.so.$(VERSION)
|
||||||
override LDFLAGS += --shared -Wl,-soname=$(SHARED_LIB_VERSIONED) -fPIC
|
override LDFLAGS += --shared -Wl,-soname=$(SHARED_LIB_VERSIONED) -fPIC
|
||||||
LDLIBS = -lpthread
|
LDLIBS := -lpthread
|
||||||
RESULT_DIR = ../lib/
|
RESULT_DIR := ../lib/
|
||||||
else
|
else
|
||||||
SHARED_LIB_BASE = libloki.dll
|
SHARED_LIB_BASE := libloki.dll
|
||||||
override LDFLAGS += --shared
|
override LDFLAGS += --shared
|
||||||
LDLIBS =
|
LDLIBS :=
|
||||||
RESULT_DIR = ../lib/
|
RESULT_DIR := ../lib/
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -38,14 +40,14 @@ ifneq ($(OS), Windows)
|
||||||
$(RM) $(SHARED_OBJ)
|
$(RM) $(SHARED_OBJ)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean cleandeps
|
||||||
$(RM) $(RESULT_DIR)$(STATIC_LIB)
|
$(RM) $(RESULT_DIR)$(STATIC_LIB)
|
||||||
$(RM) $(RESULT_DIR)$(SHARED_LIB_BASE)
|
$(RM) $(RESULT_DIR)$(SHARED_LIB_BASE)
|
||||||
ifneq ($(OS),Windows)
|
ifneq ($(OS),Windows)
|
||||||
$(RM) $(RESULT_DIR)$(SHARED_LIB_VERSIONED)
|
$(RM) $(RESULT_DIR)$(SHARED_LIB_VERSIONED)
|
||||||
|
|
||||||
INSTALL = install
|
INSTALL := install
|
||||||
INSTALL_DATA = $(INSTALL) -m 644
|
INSTALL_DATA := $(INSTALL) -m 644
|
||||||
|
|
||||||
.PHONY: install install-static install-shared
|
.PHONY: install install-static install-shared
|
||||||
install: install-static install-shared
|
install: install-static install-shared
|
||||||
|
@ -73,3 +75,5 @@ endif
|
||||||
|
|
||||||
$(RESULT_DIR)$(STATIC_LIB): $(STATIC_OBJ)
|
$(RESULT_DIR)$(STATIC_LIB): $(STATIC_OBJ)
|
||||||
$(AR) $(ARFLAGS) $@ $^
|
$(AR) $(ARFLAGS) $@ $^
|
||||||
|
|
||||||
|
include ../Makefile.deps
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
BIN = DeletableSingleton$(BIN_SUFFIX)
|
include ../Makefile.common
|
||||||
SRC = DeletableSingleton.cpp
|
|
||||||
OBJ = $(SRC:.cpp=.o)
|
BIN := DeletableSingleton$(BIN_SUFFIX)
|
||||||
|
SRC := DeletableSingleton.cpp
|
||||||
|
OBJ := $(SRC:.cpp=.o)
|
||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
all: $(BIN)
|
all: $(BIN)
|
||||||
clean:
|
clean: cleandeps
|
||||||
$(RM) $(BIN)
|
$(RM) $(BIN)
|
||||||
$(RM) $(OBJ)
|
$(RM) $(OBJ)
|
||||||
|
|
||||||
$(BIN): $(OBJ)
|
$(BIN): $(OBJ)
|
||||||
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
||||||
|
|
||||||
|
include ../../Makefile.deps
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
BIN = Factory$(BIN_SUFFIX)
|
include ../Makefile.common
|
||||||
SRC = Factory.cpp
|
|
||||||
OBJ = $(SRC:.cpp=.o)
|
BIN := Factory$(BIN_SUFFIX)
|
||||||
|
SRC := Factory.cpp
|
||||||
|
OBJ := $(SRC:.cpp=.o)
|
||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
all: $(BIN)
|
all: $(BIN)
|
||||||
clean:
|
clean: cleandeps
|
||||||
$(RM) $(BIN)
|
$(RM) $(BIN)
|
||||||
$(RM) $(OBJ)
|
$(RM) $(OBJ)
|
||||||
|
|
||||||
$(BIN): $(OBJ)
|
$(BIN): $(OBJ)
|
||||||
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
||||||
|
|
||||||
|
include ../../Makefile.deps
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
BIN = FunctionTest$(BIN_SUFFIX)
|
include ../Makefile.common
|
||||||
SRC = FunctionTest.cpp
|
|
||||||
OBJ = $(SRC:.cpp=.o)
|
BIN := FunctionTest$(BIN_SUFFIX)
|
||||||
|
SRC := FunctionTest.cpp
|
||||||
|
OBJ := $(SRC:.cpp=.o)
|
||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
all: $(BIN)
|
all: $(BIN)
|
||||||
clean:
|
clean: cleandeps
|
||||||
$(RM) $(BIN)
|
$(RM) $(BIN)
|
||||||
$(RM) $(OBJ)
|
$(RM) $(OBJ)
|
||||||
|
|
||||||
$(BIN): $(OBJ)
|
$(BIN): $(OBJ)
|
||||||
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
||||||
|
|
||||||
|
include ../../Makefile.deps
|
||||||
|
|
|
@ -1,12 +1,17 @@
|
||||||
BIN = main$(BIN_SUFFIX)
|
include ../Makefile.common
|
||||||
SRC = main.cpp
|
|
||||||
OBJ = $(SRC:.cpp=.o)
|
BIN := main$(BIN_SUFFIX)
|
||||||
|
SRC := main.cpp
|
||||||
|
OBJ := $(SRC:.cpp=.o)
|
||||||
|
LDLIBS += -lpthread
|
||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
all: $(BIN)
|
all: $(BIN)
|
||||||
clean:
|
clean: cleandeps
|
||||||
$(RM) $(BIN)
|
$(RM) $(BIN)
|
||||||
$(RM) $(OBJ)
|
$(RM) $(OBJ)
|
||||||
|
|
||||||
$(BIN): $(OBJ)
|
$(BIN): $(OBJ)
|
||||||
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
||||||
|
|
||||||
|
include ../../Makefile.deps
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
BIN1 = main$(BIN_SUFFIX)
|
include ../Makefile.common
|
||||||
SRC1 = main.cpp
|
|
||||||
OBJ1 = $(SRC1:.cpp=.o)
|
BIN1 := main$(BIN_SUFFIX)
|
||||||
BIN2 = main2$(BIN_SUFFIX)
|
SRC1 := main.cpp
|
||||||
SRC2 = main2.cpp
|
OBJ1 := $(SRC1:.cpp=.o)
|
||||||
OBJ2 = $(SRC2:.cpp=.o)
|
BIN2 := main2$(BIN_SUFFIX)
|
||||||
override CXXFLAGS = $(CXXWARNFLAGS) -g -fexpensive-optimizations -O3
|
SRC2 := main2.cpp
|
||||||
|
OBJ2 := $(SRC2:.cpp=.o)
|
||||||
|
CXXFLAGS := $(CXXWARNFLAGS) -g -fexpensive-optimizations -O3
|
||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
all: $(BIN1) $(BIN2)
|
all: $(BIN1) $(BIN2)
|
||||||
clean:
|
clean: cleandeps
|
||||||
$(RM) $(BIN1)
|
$(RM) $(BIN1)
|
||||||
$(RM) $(OBJ1)
|
$(RM) $(OBJ1)
|
||||||
$(RM) $(BIN2)
|
$(RM) $(BIN2)
|
||||||
|
@ -19,3 +21,5 @@ $(BIN1): $(OBJ1)
|
||||||
|
|
||||||
$(BIN2): $(OBJ2)
|
$(BIN2): $(OBJ2)
|
||||||
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
||||||
|
|
||||||
|
include ../../Makefile.deps
|
||||||
|
|
|
@ -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_ORIG := $(patsubst %/,%,$(dir $(wildcard */Makefile)))
|
||||||
SUBTARGETS := $(filter-out $(SUBTARGETS_FILTER_OUT),$(SUBTARGETS_ORIG))
|
SUBTARGETS := $(filter-out $(SUBTARGETS_FILTER_OUT),$(SUBTARGETS_ORIG))
|
||||||
|
|
||||||
|
|
11
test/Makefile.common
Normal file
11
test/Makefile.common
Normal 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
|
|
@ -1,12 +1,16 @@
|
||||||
BIN = main$(BIN_SUFFIX)
|
include ../Makefile.common
|
||||||
SRC = main.cpp
|
|
||||||
OBJ = $(SRC:.cpp=.o)
|
BIN := main$(BIN_SUFFIX)
|
||||||
|
SRC := main.cpp
|
||||||
|
OBJ := $(SRC:.cpp=.o)
|
||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
all: $(BIN)
|
all: $(BIN)
|
||||||
clean:
|
clean: cleandeps
|
||||||
$(RM) $(BIN)
|
$(RM) $(BIN)
|
||||||
$(RM) $(OBJ)
|
$(RM) $(OBJ)
|
||||||
|
|
||||||
$(BIN): $(OBJ)
|
$(BIN): $(OBJ)
|
||||||
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
||||||
|
|
||||||
|
include ../../Makefile.deps
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
BIN = main$(BIN_SUFFIX)
|
include ../Makefile.common
|
||||||
SRC = main.cpp
|
|
||||||
OBJ = $(SRC:.cpp=.o)
|
BIN := main$(BIN_SUFFIX)
|
||||||
|
SRC := main.cpp
|
||||||
|
OBJ := $(SRC:.cpp=.o)
|
||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
all: $(BIN)
|
all: $(BIN)
|
||||||
clean:
|
clean: cleandeps
|
||||||
$(RM) $(BIN)
|
$(RM) $(BIN)
|
||||||
$(RM) $(OBJ)
|
$(RM) $(OBJ)
|
||||||
|
|
||||||
$(BIN): $(OBJ)
|
$(BIN): $(OBJ)
|
||||||
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
||||||
|
|
||||||
|
include ../../Makefile.deps
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
BIN1 = main$(BIN_SUFFIX)
|
include ../Makefile.common
|
||||||
SRC1 = main.cpp
|
|
||||||
OBJ1 = $(SRC1:.cpp=.o)
|
BIN1 := main$(BIN_SUFFIX)
|
||||||
LIB1 = libfoo.a
|
SRC1 := main.cpp
|
||||||
SRC2 = foo.cpp
|
OBJ1 := $(SRC1:.cpp=.o)
|
||||||
OBJ2 = $(SRC2:.cpp=.o)
|
LIB1 := libfoo.a
|
||||||
override CPPFLAGS += -DLOKI_FUNCTOR_IS_NOT_A_SMALLOBJECT
|
SRC2 := foo.cpp
|
||||||
|
OBJ2 := $(SRC2:.cpp=.o)
|
||||||
|
CPPFLAGS += -DLOKI_FUNCTOR_IS_NOT_A_SMALLOBJECT
|
||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
all: $(BIN1)
|
all: $(BIN1)
|
||||||
|
@ -15,8 +17,10 @@ $(BIN1): $(OBJ1) $(LIB1)
|
||||||
$(LIB1): $(OBJ2)
|
$(LIB1): $(OBJ2)
|
||||||
$(AR) $(ARFLAGS) $@ $^
|
$(AR) $(ARFLAGS) $@ $^
|
||||||
|
|
||||||
clean:
|
clean: cleandeps
|
||||||
$(RM) $(BIN1)
|
$(RM) $(BIN1)
|
||||||
$(RM) $(OBJ1)
|
$(RM) $(OBJ1)
|
||||||
$(RM) $(LIB1)
|
$(RM) $(LIB1)
|
||||||
$(RM) $(OBJ2)
|
$(RM) $(OBJ2)
|
||||||
|
|
||||||
|
include ../../Makefile.deps
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
BIN = Test$(BIN_SUFFIX)
|
include ../Makefile.common
|
||||||
SRC = Test.cpp
|
|
||||||
OBJ = $(SRC:.cpp=.o)
|
BIN := Test$(BIN_SUFFIX)
|
||||||
|
SRC := Test.cpp
|
||||||
|
OBJ := $(SRC:.cpp=.o)
|
||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
all: $(BIN)
|
all: $(BIN)
|
||||||
clean:
|
clean: cleandeps
|
||||||
$(RM) $(BIN)
|
$(RM) $(BIN)
|
||||||
$(RM) $(OBJ)
|
$(RM) $(OBJ)
|
||||||
|
|
||||||
$(BIN): $(OBJ)
|
$(BIN): $(OBJ)
|
||||||
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
||||||
|
|
||||||
|
include ../../Makefile.deps
|
||||||
|
|
|
@ -1,13 +1,17 @@
|
||||||
BIN = main$(BIN_SUFFIX)
|
include ../Makefile.common
|
||||||
SRC = main.cpp
|
|
||||||
OBJ = $(SRC:.cpp=.o)
|
BIN := main$(BIN_SUFFIX)
|
||||||
override CXXFLAGS = $(CXXWARNFLAGS) -g -fexpensive-optimizations -O3
|
SRC := main.cpp
|
||||||
|
OBJ := $(SRC:.cpp=.o)
|
||||||
|
CXXFLAGS := $(CXXWARNFLAGS) -g -fexpensive-optimizations -O3
|
||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
all: $(BIN)
|
all: $(BIN)
|
||||||
clean:
|
clean: cleandeps
|
||||||
$(RM) $(BIN)
|
$(RM) $(BIN)
|
||||||
$(RM) $(OBJ)
|
$(RM) $(OBJ)
|
||||||
|
|
||||||
$(BIN): $(OBJ)
|
$(BIN): $(OBJ)
|
||||||
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
||||||
|
|
||||||
|
include ../../Makefile.deps
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
BIN = main$(BIN_SUFFIX)
|
include ../Makefile.common
|
||||||
SRC = main.cpp
|
|
||||||
OBJ = $(SRC:.cpp=.o)
|
BIN := main$(BIN_SUFFIX)
|
||||||
|
SRC := main.cpp
|
||||||
|
OBJ := $(SRC:.cpp=.o)
|
||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
all: $(BIN)
|
all: $(BIN)
|
||||||
clean:
|
clean: cleandeps
|
||||||
$(RM) $(BIN)
|
$(RM) $(BIN)
|
||||||
$(RM) $(OBJ)
|
$(RM) $(OBJ)
|
||||||
|
|
||||||
$(BIN): $(OBJ)
|
$(BIN): $(OBJ)
|
||||||
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
||||||
|
|
||||||
|
include ../../Makefile.deps
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
BIN1 = Dependencies$(BIN_SUFFIX)
|
include ../Makefile.common
|
||||||
SRC1 = Dependencies.cpp
|
|
||||||
OBJ1 = $(SRC1:.cpp=.o)
|
BIN1 := Dependencies$(BIN_SUFFIX)
|
||||||
BIN2 = Phoenix$(BIN_SUFFIX)
|
SRC1 := Dependencies.cpp
|
||||||
SRC2 = Phoenix.cpp
|
OBJ1 := $(SRC1:.cpp=.o)
|
||||||
OBJ2 = $(SRC2:.cpp=.o)
|
BIN2 := Phoenix$(BIN_SUFFIX)
|
||||||
|
SRC2 := Phoenix.cpp
|
||||||
|
OBJ2 := $(SRC2:.cpp=.o)
|
||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
all: $(BIN1) $(BIN2)
|
all: $(BIN1) $(BIN2)
|
||||||
clean:
|
clean: cleandeps
|
||||||
$(RM) $(BIN1)
|
$(RM) $(BIN1)
|
||||||
$(RM) $(OBJ1)
|
$(RM) $(OBJ1)
|
||||||
$(RM) $(BIN2)
|
$(RM) $(BIN2)
|
||||||
|
@ -18,3 +20,5 @@ $(BIN1): $(OBJ1)
|
||||||
|
|
||||||
$(BIN2): $(OBJ2)
|
$(BIN2): $(OBJ2)
|
||||||
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
||||||
|
|
||||||
|
include ../../Makefile.deps
|
||||||
|
|
|
@ -1,26 +1,29 @@
|
||||||
|
include ../Makefile.common
|
||||||
|
|
||||||
ifeq ($(OS),Darwin)
|
ifeq ($(OS),Darwin)
|
||||||
LIB1 = libfoo.dylib
|
LIB1 := libfoo.dylib
|
||||||
LIB2 = libsingletondll.dylib
|
LIB2 := libsingletondll.dylib
|
||||||
SHARED_LIB_FLAG = -dynamiclib
|
SHARED_LIB_FLAG := -dynamiclib
|
||||||
else
|
else
|
||||||
ifeq ($(OS),Linux)
|
ifeq ($(OS),Linux)
|
||||||
LIB1 = libfoo.so
|
LIB1 := libfoo.so
|
||||||
LIB2 = libsingletondll.so
|
LIB2 := libsingletondll.so
|
||||||
SHARED_LIB_FLAG = --shared
|
SHARED_LIB_FLAG := --shared
|
||||||
else
|
else
|
||||||
LIB1 = foo.dll
|
LIB1 := foo.dll
|
||||||
LIB2 = singletondll.dll
|
LIB2 := singletondll.dll
|
||||||
SHARED_LIB_FLAG = --shared
|
SHARED_LIB_FLAG := --shared
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
BIN1 = client$(BIN_SUFFIX)
|
BIN1 := client$(BIN_SUFFIX)
|
||||||
SRC1 = client.cpp
|
SRC1 := client.cpp
|
||||||
OBJ1 = $(SRC1:.cpp=.o)
|
OBJ1 := $(SRC1:.cpp=.o)
|
||||||
SRC2 = foo.cpp
|
SRC2 := foo.cpp
|
||||||
OBJ2 = $(SRC2:.cpp=.o)
|
OBJ2 := $(SRC2:.cpp=.o)
|
||||||
SRC3 = singletondll.cpp
|
SRC3 := singletondll.cpp
|
||||||
OBJ3 = $(SRC3:.cpp=.o)
|
OBJ3 := $(SRC3:.cpp=.o)
|
||||||
|
override LDFLAGS := -L../../lib
|
||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
all: $(BIN1)
|
all: $(BIN1)
|
||||||
|
@ -34,10 +37,12 @@ $(LIB1): $(OBJ2)
|
||||||
$(LIB2): $(OBJ3)
|
$(LIB2): $(OBJ3)
|
||||||
$(CXX) $(SHARED_LIB_FLAG) $(LDFLAGS) -L. -o $@ $^ -lfoo $(LDLIBS)
|
$(CXX) $(SHARED_LIB_FLAG) $(LDFLAGS) -L. -o $@ $^ -lfoo $(LDLIBS)
|
||||||
|
|
||||||
clean:
|
clean: cleandeps
|
||||||
$(RM) $(BIN1)
|
$(RM) $(BIN1)
|
||||||
$(RM) $(OBJ1)
|
$(RM) $(OBJ1)
|
||||||
$(RM) $(LIB1)
|
$(RM) $(LIB1)
|
||||||
$(RM) $(OBJ2)
|
$(RM) $(OBJ2)
|
||||||
$(RM) $(LIB2)
|
$(RM) $(LIB2)
|
||||||
$(RM) $(OBJ3)
|
$(RM) $(OBJ3)
|
||||||
|
|
||||||
|
include ../../Makefile.deps
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
BIN1 = SmallObjBench$(BIN_SUFFIX)
|
include ../Makefile.common
|
||||||
SRC1 = SmallObjBench.cpp
|
|
||||||
OBJ1 = $(SRC1:.cpp=.o)
|
BIN1 := SmallObjBench$(BIN_SUFFIX)
|
||||||
BIN2 = SmallObjSingleton$(BIN_SUFFIX)
|
SRC1 := SmallObjBench.cpp
|
||||||
SRC2 = SmallObjSingleton.cpp
|
OBJ1 := $(SRC1:.cpp=.o)
|
||||||
OBJ2 = $(SRC2:.cpp=.o)
|
BIN2 := SmallObjSingleton$(BIN_SUFFIX)
|
||||||
override CXXFLAGS = $(CXXWARNFLAGS) -g -fexpensive-optimizations -O3
|
SRC2 := SmallObjSingleton.cpp
|
||||||
|
OBJ2 := $(SRC2:.cpp=.o)
|
||||||
|
CXXFLAGS := $(CXXWARNFLAGS) -g -fexpensive-optimizations -O3
|
||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
all: $(BIN1) $(BIN2)
|
all: $(BIN1) $(BIN2)
|
||||||
clean:
|
clean: cleandeps
|
||||||
$(RM) $(BIN1)
|
$(RM) $(BIN1)
|
||||||
$(RM) $(OBJ1)
|
$(RM) $(OBJ1)
|
||||||
$(RM) $(BIN2)
|
$(RM) $(BIN2)
|
||||||
|
@ -19,3 +21,5 @@ $(BIN1): $(OBJ1)
|
||||||
|
|
||||||
$(BIN2): $(OBJ2)
|
$(BIN2): $(OBJ2)
|
||||||
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
||||||
|
|
||||||
|
include ../../Makefile.deps
|
||||||
|
|
|
@ -1,12 +1,17 @@
|
||||||
BIN = main$(BIN_SUFFIX)
|
include ../Makefile.common
|
||||||
SRC = main.cpp strong.cpp LockTest.cpp
|
|
||||||
OBJ = $(SRC:.cpp=.o)
|
BIN := main$(BIN_SUFFIX)
|
||||||
|
SRC := main.cpp strong.cpp LockTest.cpp
|
||||||
|
OBJ := $(SRC:.cpp=.o)
|
||||||
|
LDLIBS += -lpthread
|
||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
all: $(BIN)
|
all: $(BIN)
|
||||||
clean:
|
clean: cleandeps
|
||||||
$(RM) $(BIN)
|
$(RM) $(BIN)
|
||||||
$(RM) $(OBJ)
|
$(RM) $(OBJ)
|
||||||
|
|
||||||
$(BIN): $(OBJ)
|
$(BIN): $(OBJ)
|
||||||
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
||||||
|
|
||||||
|
include ../../Makefile.deps
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
BIN = main$(BIN_SUFFIX)
|
include ../Makefile.common
|
||||||
SRC = main.cpp
|
|
||||||
OBJ = $(SRC:.cpp=.o)
|
BIN := main$(BIN_SUFFIX)
|
||||||
|
SRC := main.cpp
|
||||||
|
OBJ := $(SRC:.cpp=.o)
|
||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
all: $(BIN)
|
all: $(BIN)
|
||||||
clean:
|
clean: cleandeps
|
||||||
$(RM) $(BIN)
|
$(RM) $(BIN)
|
||||||
$(RM) $(OBJ)
|
$(RM) $(OBJ)
|
||||||
|
|
||||||
$(BIN): $(OBJ)
|
$(BIN): $(OBJ)
|
||||||
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
||||||
|
|
||||||
|
include ../../Makefile.deps
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
BIN = main$(BIN_SUFFIX)
|
include ../Makefile.common
|
||||||
SRC = main.cpp
|
|
||||||
OBJ = $(SRC:.cpp=.o)
|
BIN := main$(BIN_SUFFIX)
|
||||||
override LDFLAGS =
|
SRC := main.cpp
|
||||||
override LDLIBS =
|
OBJ := $(SRC:.cpp=.o)
|
||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
all: $(BIN)
|
all: $(BIN)
|
||||||
clean:
|
clean: cleandeps
|
||||||
$(RM) $(BIN)
|
$(RM) $(BIN)
|
||||||
$(RM) $(OBJ)
|
$(RM) $(OBJ)
|
||||||
|
|
||||||
$(BIN): $(OBJ)
|
$(BIN): $(OBJ)
|
||||||
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
||||||
|
|
||||||
|
include ../../Makefile.deps
|
||||||
|
|
Loading…
Reference in a new issue