-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (38 loc) · 1.25 KB
/
Copy pathMakefile
File metadata and controls
53 lines (38 loc) · 1.25 KB
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
52
53
INC_LIBJSON_PATH=json-c
CC=gcc
CFLAGS=-Wall -O2 -s -fPIC -std=gnu99 -I/usr/include/$(INC_LIBJSON_PATH)
LD_SONAME=-Wl,-soname,libnss_http.so.2
LIBRARY=libnss_http.so.2.0
LINKS=libnss_http.so.2 libnss_http.so
PREFIX=/usr
LIBDIR=$(DESTDIR)$(PREFIX)/lib
BUILD=build
default: build
build: nss_http
nss_http_build_dir:
[ -d $(BUILD) ] || mkdir $(BUILD)
nss_http-passwd:
$(CC) $(CFLAGS) -c src/nss_http-passwd.c -o $(BUILD)/nss_http-passwd.o
nss_http-group:
$(CC) $(CFLAGS) -c src/nss_http-group.c -o $(BUILD)/nss_http-group.o
nss_http-shadow:
$(CC) $(CFLAGS) -c src/nss_http-shadow.c -o $(BUILD)/nss_http-shadow.o
nss_http_services: nss_http-passwd nss_http-group nss_http-shadow
nss_http: nss_http_build_dir nss_http_services
$(CC) $(CFLAGS) -c src/nss_http.c -o $(BUILD)/nss_http.o
$(CC) -shared $(LD_SONAME) \
-o $(BUILD)/$(LIBRARY) \
$(BUILD)/nss_http.o \
$(BUILD)/nss_http-passwd.o \
$(BUILD)/nss_http-group.o \
$(BUILD)/nss_http-shadow.o \
-l$(INC_LIBJSON_PATH) \
-lcurl
strip $(BUILD)/$(LIBRARY)
clean:
rm -rf $(BUILD)
install:
[ -d $(LIBDIR) ] || install -d $(LIBDIR)
install $(BUILD)/$(LIBRARY) $(LIBDIR)
cd $(LIBDIR); for link in $(LINKS); do ln -sf $(LIBRARY) $$link ; done
.PHONY: clean install nss_http_build_dir nss_http