Lines 11-17
INSTALL = install
Link Here
|
11 |
# APIVERSION is used in soname |
11 |
# APIVERSION is used in soname |
12 |
APIVERSION = 1 |
12 |
APIVERSION = 1 |
13 |
#LDFLAGS = -Wl,--no-undefined |
13 |
#LDFLAGS = -Wl,--no-undefined |
14 |
CFLAGS = -O -fPIC -Wall -DENABLE_STRNATPMPERR |
14 |
CFLAGS := -O -fPIC -Wall -DENABLE_STRNATPMPERR $(CFLAGS) |
|
|
15 |
LIBDIR ?= lib |
15 |
|
16 |
|
16 |
LIBOBJS = natpmp.o getgateway.o |
17 |
LIBOBJS = natpmp.o getgateway.o |
17 |
|
18 |
|
Lines 29-39
endif
Link Here
|
29 |
|
30 |
|
30 |
HEADERS = natpmp.h |
31 |
HEADERS = natpmp.h |
31 |
|
32 |
|
32 |
EXECUTABLES = testgetgateway natpmpc-shared natpmpc-static |
33 |
EXECUTABLES = testgetgateway natpmpc-shared |
33 |
|
34 |
|
34 |
INSTALLPREFIX ?= $(PREFIX)/usr |
35 |
INSTALLPREFIX ?= $(PREFIX)/usr |
35 |
INSTALLDIRINC = $(INSTALLPREFIX)/include |
36 |
INSTALLDIRINC = $(INSTALLPREFIX)/include |
36 |
INSTALLDIRLIB = $(INSTALLPREFIX)/lib |
37 |
INSTALLDIRLIB = $(INSTALLPREFIX)/$(LIBDIR) |
37 |
INSTALLDIRBIN = $(INSTALLPREFIX)/bin |
38 |
INSTALLDIRBIN = $(INSTALLPREFIX)/bin |
38 |
|
39 |
|
39 |
.PHONY: all clean depend install cleaninstall installpythonmodule |
40 |
.PHONY: all clean depend install cleaninstall installpythonmodule |
Lines 74-92
cleaninstall:
Link Here
|
74 |
testgetgateway: testgetgateway.o getgateway.o |
75 |
testgetgateway: testgetgateway.o getgateway.o |
75 |
|
76 |
|
76 |
natpmpc-static: natpmpc.o $(STATICLIB) |
77 |
natpmpc-static: natpmpc.o $(STATICLIB) |
77 |
$(CC) $(LDFLAGS) -o $@ $^ |
78 |
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ |
78 |
|
79 |
|
79 |
natpmpc-shared: natpmpc.o $(SHAREDLIB) |
80 |
natpmpc-shared: natpmpc.o $(SHAREDLIB) |
80 |
$(CC) $(LDFLAGS) -o $@ $^ |
81 |
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ |
81 |
|
82 |
|
82 |
$(STATICLIB): $(LIBOBJS) |
83 |
$(STATICLIB): $(LIBOBJS) |
83 |
$(AR) crs $@ $? |
84 |
$(AR) crs $@ $? |
84 |
|
85 |
|
85 |
$(SHAREDLIB): $(LIBOBJS) |
86 |
$(SHAREDLIB): $(LIBOBJS) |
86 |
ifeq ($(OS), Darwin) |
87 |
ifeq ($(OS), Darwin) |
87 |
$(CC) -dynamiclib -Wl,-install_name,$(SONAME) -o $@ $^ |
88 |
$(CC) $(LDFLAGS) -dynamiclib -Wl,-install_name,$(SONAME) -o $@ $^ |
88 |
else |
89 |
else |
89 |
$(CC) -shared -Wl,-soname,$(SONAME) -o $@ $^ |
90 |
$(CC) $(LDFLAGS) -shared -Wl,-soname,$(SONAME) -o $@ $^ |
90 |
endif |
91 |
endif |
91 |
|
92 |
|
92 |
# DO NOT DELETE |
93 |
# DO NOT DELETE |