summaryrefslogtreecommitdiff
path: root/package/ppp/patches/patch-pppd_plugins_Makefile_linux
blob: ce28a1e2ce0bcb528eeaa67203a9be4fc0b14ca0 (plain)
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
39
40
41
42
43
44
45
46
47
--- ppp-2.4.7.orig/pppd/plugins/Makefile.linux	2014-08-09 14:31:39.000000000 +0200
+++ ppp-2.4.7/pppd/plugins/Makefile.linux	2015-06-09 11:14:41.000000000 +0200
@@ -1,13 +1,13 @@
-#CC	= gcc
-COPTS	= -O2 -g
-CFLAGS	= $(COPTS) -I.. -I../../include -fPIC
-LDFLAGS	= -shared
-INSTALL	= install
+#
+# makefile for pppd/plugins
+#
+VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../patchlevel.h)
 
-DESTDIR = $(INSTROOT)@DESTDIR@
-BINDIR = $(DESTDIR)/sbin
-MANDIR = $(DESTDIR)/share/man/man8
-LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION)
+include ../../Makedefs.com
+
+CPPFLAGS += -I.. -I../../include
+CFLAGS	+= -fPIC
+LDFLAGS	+= -shared
 
 SUBDIRS := rp-pppoe pppoatm pppol2tp
 # Uncomment the next line to include the radius authentication plugin
@@ -30,12 +30,10 @@ all:	$(PLUGINS)
 	for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d all; done
 
 %.so: %.c
-	$(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^
-
-VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../patchlevel.h)
+	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^
 
 install: $(PLUGINS)
-	$(INSTALL) -d $(LIBDIR)
+	$(INSTALL) -d -m 755 $(LIBDIR)
 	$(INSTALL) $? $(LIBDIR)
 	for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d install; done
 
@@ -44,5 +42,4 @@ clean:
 	for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d clean; done
 
 depend:
-	$(CPP) -M $(CFLAGS) *.c >.depend
-	for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d depend; done
+	$(CPP) -M $(CPPFLAGS) *.c >.depend