• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#CC	= gcc
2COPTS	= -O2 -g
3CFLAGS	= $(COPTS) -I../.. -I../../../include -fPIC
4LDFLAGS	= -shared
5INSTALL	= install
6
7#***********************************************************************
8
9DESTDIR = $(INSTROOT)@DESTDIR@
10LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION)
11
12VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../../patchlevel.h)
13
14PLUGIN := pppoatm.so
15PLUGIN_OBJS := pppoatm.o
16
17#*******
18# Do we have the ATM libraries installed? Set HAVE_LIBATM to use them,
19# or leave it unset to build the few routines we actually _use_ into
20# the plugin directly.
21#
22#HAVE_LIBATM=yes
23
24ifdef HAVE_LIBATM
25LIBS := -latm
26else
27CFLAGS += -I.
28PLUGIN_OBJS += text2qos.o text2atm.o misc.o ans.o
29LIBS := -lresolv
30endif
31
32#*********
33all: $(PLUGIN)
34
35$(PLUGIN): $(PLUGIN_OBJS)
36	$(CC) $(CFLAGS) -o $@ -shared $^ $(LIBS)
37
38install: all
39	$(INSTALL) -d -m 755 $(LIBDIR)
40	$(INSTALL) -c -m 4550 $(PLUGIN) $(LIBDIR)
41
42clean:
43	rm -f *.o *.so
44
45%.o: %.c
46	$(CC) $(CFLAGS) -c -o $@ $<
47