-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
38 lines (30 loc) · 895 Bytes
/
Makefile
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
# Makefile for libnss-openvpn
CC = gcc
prefix = /usr
exec_prefix = ${prefix}
BITSOFS=
libprefix = ${exec_prefix}/lib$(BITSOFS)
DESTDIR=
OBJSUFFIX=$(BITSOFS).o
OBJECTS=libnss_openvpn$(OBJSUFFIX)
SHARED_OBJECT = libnss_openvpn$(BITSOFS).so.2
INSTALL_NAME = libnss_openvpn.so.2
# This only works sometimes, give manually when needed:
BIT_CFLAGS = $(if $(BITSOFS),-m$(BITSOFS))
CFLAGS = $(BIT_CFLAGS) -g -O2 -Wall -Wpointer-arith
CPPFLAGS =
LIBS =
LDFLAGS = -shared -Wl,-soname,$(INSTALL_NAME) -Wl,-z,defs
all: $(SHARED_OBJECT)
$(SHARED_OBJECT): $(OBJECTS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $(SHARED_OBJECT) $(OBJECTS) $(LIBS)
%$(OBJSUFFIX): %.c
$(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -c -o $@ $<
install:
install -m755 -d $(DESTDIR)$(libprefix)/
install -m644 $(SHARED_OBJECT) $(DESTDIR)$(libprefix)/$(INSTALL_NAME)
clean:
rm -f $(OBJECTS)
rm -f $(SHARED_OBJECT)
distclean: clean
.PHONY: all