Resolve “gateway.localhost” instead of “gateway.current” (Closes: #574561)
[libnss-gw-name.git] / Makefile
1 # Makefile for libnss-gw-name
2
3 CC = gcc
4 prefix = /usr
5 exec_prefix = ${prefix}
6 BITSOFS=
7 libprefix = ${exec_prefix}/lib$(BITSOFS)
8 DESTDIR=
9 OBJSUFFIX=$(BITSOFS).o
10 OBJECTS=libnss_gw_name$(OBJSUFFIX) 
11 SHARED_OBJECT = libnss_gw_name$(BITSOFS).so.2
12 INSTALL_NAME = libnss_gw_name.so.2
13 # This only works sometimes, give manually when needed:
14 BIT_CFLAGS = $(if $(BITSOFS),-m$(BITSOFS))
15 CFLAGS = $(BIT_CFLAGS) -g -O2 -Wall -Wpointer-arith
16 CPPFLAGS =
17 LIBS = `pkg-config --libs libnl-1`
18 LDFLAGS = -shared -Wl,-soname,$(INSTALL_NAME) -Wl,-z,defs --no-allow-shlib-undefined
19
20 all: $(SHARED_OBJECT)
21
22 $(SHARED_OBJECT): $(OBJECTS)
23         $(CC) $(CFLAGS) $(LDFLAGS) -o $(SHARED_OBJECT) $(OBJECTS) $(LIBS)
24
25 %$(OBJSUFFIX): %.c
26         $(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -c -o $@ $<
27
28 install:
29         install -m755 -d $(DESTDIR)$(libprefix)/
30         install -m644 $(SHARED_OBJECT) $(DESTDIR)$(libprefix)/$(INSTALL_NAME)
31
32 clean:
33         rm -f $(OBJECTS)
34         rm -f $(SHARED_OBJECT)
35
36 distclean: clean
37
38 .PHONY: all