2006-03-21 21:01:18 +00:00
|
|
|
_OS = $(shell uname -s)
|
|
|
|
ifeq ($(_OS), Darwin)
|
|
|
|
SHARED_LIB_FILENAME = dylib
|
|
|
|
SHARED_LIB_FLAG = -dynamiclib
|
|
|
|
else
|
|
|
|
SHARED_LIB_FILENAME = so
|
|
|
|
SHARED_LIB_FLAG = --shared
|
|
|
|
endif
|
|
|
|
|
2006-03-02 21:19:41 +00:00
|
|
|
BIN = client
|
2006-03-21 21:01:18 +00:00
|
|
|
LIB1 = libfoo.$(SHARED_LIB_FILENAME)
|
|
|
|
LIB2 = libsingletondll.$(SHARED_LIB_FILENAME)
|
2006-03-03 16:30:53 +00:00
|
|
|
#mingw names
|
|
|
|
#LIB1 = foo.dll
|
|
|
|
#LIB2 = singletondll.dll
|
2006-03-02 21:19:41 +00:00
|
|
|
CXXFLAGS = -Wall -Wold-style-cast -Wundef -Wsign-compare -Wconversion -Wpointer-arith -pedantic -O2
|
|
|
|
CPPFLAGS = -I../../include -DNDEBUG
|
2006-03-03 16:30:53 +00:00
|
|
|
LDFLAGS = -L../../lib
|
2006-03-02 21:19:41 +00:00
|
|
|
LDLIBS = -lloki
|
|
|
|
|
|
|
|
.PHONY: build clean
|
|
|
|
build: $(BIN)
|
|
|
|
|
|
|
|
$(BIN): $(LIB1) $(LIB2)
|
|
|
|
$(CXX) $(CXXFLAGS) -L. $(LDFLAGS) $(CPPFLAGS) -o $(BIN) client.cpp $(LDLIBS) -lfoo -lsingletondll
|
|
|
|
|
|
|
|
$(LIB1): foo.cpp
|
2006-03-21 21:01:18 +00:00
|
|
|
$(CXX) $(SHARED_LIB_FLAG) $(CXXFLAGS) $(CPPFLAGS) -o $(LIB1) foo.cpp
|
2006-03-02 21:19:41 +00:00
|
|
|
|
|
|
|
$(LIB2): singletondll.cpp
|
2006-03-21 21:01:18 +00:00
|
|
|
$(CXX) $(SHARED_LIB_FLAG) $(CXXFLAGS) $(CPPFLAGS) -o $(LIB2) singletondll.cpp -L. -lfoo
|
2006-03-02 21:19:41 +00:00
|
|
|
|
|
|
|
clean:
|
2006-03-21 21:01:18 +00:00
|
|
|
rm -f $(BIN) client.o foo.o singleton.o $(LIB1) $(LIB2)
|