-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (30 loc) · 889 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-winz
CC = g++
prefix = /usr
exec_prefix = ${prefix}
BITSOFS=
libprefix = ${exec_prefix}/lib$(BITSOFS)
DESTDIR=
OBJSUFFIX=$(BITSOFS).o
OBJECTS=main$(OBJSUFFIX)
SHARED_OBJECT = libnss_winz$(BITSOFS).so.2
INSTALL_NAME = libnss_winz.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 = -std=c++11
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): %.cpp
$(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