2006-07-14 07:31:37 +00:00
|
|
|
include ../Makefile.common
|
|
|
|
|
2006-04-18 07:29:41 +00:00
|
|
|
ifeq ($(OS),Darwin)
|
2006-07-14 07:31:37 +00:00
|
|
|
LIB1 := libfoo.dylib
|
|
|
|
LIB2 := libsingletondll.dylib
|
2006-11-05 13:09:00 +00:00
|
|
|
SHARED_LIB_FLAG := -dynamiclib -fPIC
|
2006-03-21 21:01:18 +00:00
|
|
|
else
|
2006-04-18 07:29:41 +00:00
|
|
|
ifeq ($(OS),Linux)
|
2006-07-14 07:31:37 +00:00
|
|
|
LIB1 := libfoo.so
|
|
|
|
LIB2 := libsingletondll.so
|
2006-11-05 13:09:00 +00:00
|
|
|
SHARED_LIB_FLAG := --shared -fPIC
|
2006-04-18 07:29:41 +00:00
|
|
|
else
|
2006-07-14 07:31:37 +00:00
|
|
|
LIB1 := foo.dll
|
|
|
|
LIB2 := singletondll.dll
|
|
|
|
SHARED_LIB_FLAG := --shared
|
2006-04-18 07:29:41 +00:00
|
|
|
endif
|
2006-03-21 21:01:18 +00:00
|
|
|
endif
|
|
|
|
|
2006-07-14 07:31:37 +00:00
|
|
|
BIN1 := client$(BIN_SUFFIX)
|
|
|
|
SRC1 := client.cpp
|
|
|
|
OBJ1 := $(SRC1:.cpp=.o)
|
|
|
|
SRC2 := foo.cpp
|
2006-11-05 13:09:00 +00:00
|
|
|
OBJ2 := $(SRC2:.cpp=.lo)
|
2006-07-14 07:31:37 +00:00
|
|
|
SRC3 := singletondll.cpp
|
2006-11-05 13:09:00 +00:00
|
|
|
OBJ3 := $(SRC3:.cpp=.lo)
|
2006-07-14 07:31:37 +00:00
|
|
|
override LDFLAGS := -L../../lib
|
2006-03-02 21:19:41 +00:00
|
|
|
|
2006-04-18 07:29:41 +00:00
|
|
|
.PHONY: all clean
|
|
|
|
all: $(BIN1)
|
2006-03-02 21:19:41 +00:00
|
|
|
|
2006-11-05 13:09:00 +00:00
|
|
|
%.lo : %.cpp
|
|
|
|
$(CXX) -c $(CXXFLAGS) -fPIC $(CPPFLAGS) -o $@ $<
|
|
|
|
|
2006-04-18 07:29:41 +00:00
|
|
|
$(BIN1): $(OBJ1) $(LIB1) $(LIB2)
|
|
|
|
$(CXX) -L. $(LDFLAGS) -o $@ $(OBJ1) $(LDLIBS) -lfoo -lsingletondll
|
2006-03-02 21:19:41 +00:00
|
|
|
|
2006-04-18 07:29:41 +00:00
|
|
|
$(LIB1): $(OBJ2)
|
|
|
|
$(CXX) $(SHARED_LIB_FLAG) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
2006-03-02 21:19:41 +00:00
|
|
|
|
2007-07-01 20:01:44 +00:00
|
|
|
$(LIB2): $(OBJ3) $(LIB1)
|
2006-04-18 07:29:41 +00:00
|
|
|
$(CXX) $(SHARED_LIB_FLAG) $(LDFLAGS) -L. -o $@ $^ -lfoo $(LDLIBS)
|
2006-03-02 21:19:41 +00:00
|
|
|
|
2006-07-14 07:31:37 +00:00
|
|
|
clean: cleandeps
|
2006-04-18 07:29:41 +00:00
|
|
|
$(RM) $(BIN1)
|
|
|
|
$(RM) $(OBJ1)
|
|
|
|
$(RM) $(LIB1)
|
|
|
|
$(RM) $(OBJ2)
|
|
|
|
$(RM) $(LIB2)
|
|
|
|
$(RM) $(OBJ3)
|
2006-07-14 07:31:37 +00:00
|
|
|
|
|
|
|
include ../../Makefile.deps
|