OSDN Git Service

Fix no pic
[uclinux-h8/uClinux-dist.git] / user / pptp / Makefile
1 # $Id: Makefile,v 1.47 2008/05/14 06:32:52 quozl Exp $
2 VERSION=1.7.2
3 RELEASE=
4
5 #################################################################
6 # CHANGE THIS LINE to point to the location of your pppd binary.
7 PPPD = /bin/pppd
8 #################################################################
9
10 BINDIR=$(DESTDIR)/usr/sbin
11 MANDIR=$(DESTDIR)/usr/share/man/man8
12 PPPDIR=$(DESTDIR)/etc/ppp
13
14 ifeq (uclinux,0)
15 CC      = gcc
16 RM      = rm -f
17 OPTIMIZE= -O0
18 DEBUG   = -g
19 INCLUDE =
20 CFLAGS  = -Wall $(OPTIMIZE) $(DEBUG) $(INCLUDE)
21 else
22 CFLAGS  += -Wall
23 endif
24 LIBS    = -lutil
25 # Solaris 10
26 # LIBS  = -lnsl -lsocket -lresolv
27 # Solaris Nevada build 14 or above
28 # LIBS    = -lnsl -lsocket
29 LDFLAGS =
30
31 PPTP_BIN = pptp
32
33 PPTP_OBJS = pptp.o pptp_gre.o ppp_fcs.o \
34             pptp_ctrl.o dirutil.o vector.o \
35             inststr.o util.o version.o test.o \
36             pptp_quirks.o orckit_quirks.o pqueue.o pptp_callmgr.o routing.o \
37             pptp_compat.o
38
39 PPTP_DEPS = pptp_callmgr.h pptp_gre.h ppp_fcs.h util.h test.h \
40             pptp_quirks.h orckit_quirks.h config.h pqueue.h routing.h
41
42 all: config.h $(PPTP_BIN) pptpsetup.8
43
44 $(PPTP_BIN): $(PPTP_OBJS) $(PPTP_DEPS)
45         $(CC) -o $(PPTP_BIN) $(PPTP_OBJS) $(LDFLAGS) $(LIBS) $(LDLIBS)
46
47 pptpsetup.8: pptpsetup
48         pod2man $? > $@
49
50 config.h: 
51         echo "/* text added by Makefile target config.h */" > config.h
52         echo "#define PPTP_LINUX_VERSION \"$(VERSION)$(RELEASE)\"" >> config.h
53         echo "#define PPPD_BINARY \"$(PPPD)\"" >> config.h
54
55 vector_test: vector_test.o vector.o
56         $(CC) -o vector_test vector_test.o vector.o
57
58 clean:
59         $(RM) *.o config.h
60         -rm -f $(PPTP_BIN) *.elf *.gdb
61
62 clobber: clean
63         $(RM) $(PPTP_BIN) vector_test
64
65 distclean: clobber
66
67 test: vector_test
68
69 install:
70         mkdir -p $(BINDIR)
71         install -o root -m 555 pptp $(BINDIR)
72         install -o root -m 555 pptpsetup $(BINDIR)
73         mkdir -p $(MANDIR)
74         install -m 644 pptp.8 $(MANDIR)
75         install -m 644 pptpsetup.8 $(MANDIR)
76         mkdir -p $(PPPDIR)
77         install -m 644 options.pptp $(PPPDIR)
78
79 uninstall:
80         $(RM) $(BINDIR)/pptp $(MANDIR)/pptp.8
81
82 dist: clobber
83         $(RM) pptp-$(VERSION)$(RELEASE).tar.gz
84         $(RM) -r pptp-$(VERSION)
85         mkdir pptp-$(VERSION)
86         cp --recursive ChangeLog Makefile *.c *.h options.pptp pptp.8 \
87                 pptpsetup Documentation AUTHORS COPYING INSTALL NEWS \
88                 README DEVELOPERS TODO USING PROTOCOL-SECURITY \
89                 pptp-$(VERSION)/
90         $(RM) -r pptp-$(VERSION)/CVS pptp-$(VERSION)/*/CVS
91         tar czf pptp-$(VERSION)$(RELEASE).tar.gz pptp-$(VERSION)
92         $(RM) -r pptp-$(VERSION)
93         md5sum pptp-$(VERSION)$(RELEASE).tar.gz
94
95 deb:
96         chmod +x debian/rules 
97         fakeroot dpkg-buildpackage -us -uc
98         mv ../pptp_$(VERSION)-0_i386.deb .
99
100 WEB=~/public_html/external/mine/pptp/pptpconfig
101 release:
102         cp pptp_$(VERSION)-0_i386.deb $(WEB)
103         cd $(WEB);make
104
105 romfs:
106         $(ROMFSINST) -e CONFIG_USER_PPTP_PPTP /bin/pptp