File: Makefile

package info (click to toggle)
libloki 0.1.7-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 6,536 kB
  • ctags: 6,905
  • sloc: cpp: 30,476; ansic: 1,974; makefile: 415; php: 316; perl: 108
file content (51 lines) | stat: -rw-r--r-- 1,041 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
include ../Makefile.common

ifeq ($(OS),Darwin)
  LIB1 := libfoo.dylib
  LIB2 := libsingletondll.dylib
  SHARED_LIB_FLAG := -dynamiclib -fPIC
else
ifeq ($(OS),Linux)
  LIB1 := libfoo.so
  LIB2 := libsingletondll.so
  SHARED_LIB_FLAG := --shared -fPIC
else
  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=.lo)
SRC3 := singletondll.cpp
OBJ3 := $(SRC3:.cpp=.lo)
override LDFLAGS := -L../../lib

.PHONY: all clean
all: $(BIN1)

%.lo : %.cpp
	$(CXX) -c $(CXXFLAGS) -fPIC $(CPPFLAGS) -o $@ $<

$(BIN1): $(OBJ1) $(LIB1) $(LIB2)
	$(CXX) -L. $(LDFLAGS) -o $@ $(OBJ1) $(LDLIBS) -lfoo -lsingletondll

$(LIB1): $(OBJ2)
	$(CXX) $(SHARED_LIB_FLAG) $(LDFLAGS) -o $@ $^ $(LDLIBS)

$(LIB2): $(OBJ3) $(LIB1)
	$(CXX) $(SHARED_LIB_FLAG) $(LDFLAGS) -L. -o $@ $^ -lfoo $(LDLIBS)

clean: cleandeps
	$(RM) $(BIN1)
	$(RM) $(OBJ1)
	$(RM) $(LIB1)
	$(RM) $(OBJ2)
	$(RM) $(LIB2)
	$(RM) $(OBJ3)

include ../../Makefile.deps