Home | History | Annotate | Download | only in pppoatm
      1 CC	= gcc
      2 COPTS	= -O2 -g
      3 CFLAGS	= $(COPTS) -I../.. -I../../../include -fPIC
      4 LDFLAGS	= -shared
      5 INSTALL	= install
      6 
      7 #***********************************************************************
      8 
      9 DESTDIR = @DESTDIR@
     10 LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION)
     11 
     12 VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../../patchlevel.h)
     13 
     14 PLUGIN := pppoatm.so
     15 PLUGIN_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 
     24 ifdef HAVE_LIBATM
     25 LIBS := -latm
     26 else
     27 CFLAGS += -I.
     28 PLUGIN_OBJS += text2qos.o text2atm.o misc.o ans.o
     29 LIBS := -lresolv
     30 endif
     31 
     32 #*********
     33 all: $(PLUGIN)
     34 
     35 $(PLUGIN): $(PLUGIN_OBJS)
     36 	$(CC) $(CFLAGS) -o $@ -shared $^ $(LIBS)
     37 
     38 install: all
     39 	$(INSTALL) -d -m 755 $(LIBDIR)
     40 	$(INSTALL) -c -m 4550 $(PLUGIN) $(LIBDIR)
     41 
     42 clean:
     43 	rm -f *.o *.so
     44 
     45 %.o: %.c
     46 	$(CC) $(CFLAGS) -c -o $@ $<
     47