libsodium: Needed for Dnscrypto-proxy Release 1.3.0
[tomato.git] / release / src / router / rp-l2tp / Makefile
blob981be3b96f51cc66a672d3ef11026ac1ec1d8e7f
1 #***********************************************************************
3 # Makefile
5 # Makefile for L2TP code.
7 # Copyright (C) 2002 Roaring Penguin Software Inc.
9 # This software may be distributed under the terms of the GNU General
10 # Public License, Version 2, or (at your option) any later version.
12 # LIC: GPL
14 # $Id: Makefile,v 1.3.18.1 2005/08/08 12:05:25 honor Exp $
15 #***********************************************************************
17 VERSION=0.4
19 DEFINES=
20 prefix=/usr
21 exec_prefix=${prefix}
22 mandir=${prefix}/man
23 docdir=/usr/doc/l2tp-$(VERSION)
24 install=/usr/bin/install -c
25 install_dir=/usr/bin/install -c -d
26 sbindir=${exec_prefix}/sbin
28 OBJS=auth.o debug.o dgram.o main.o md5.o network.o options.o peer.o session.o tunnel.o utils.o
29 EXTRA_LIBS=libevent/*.o -ldl
31 SRCS=$(OBJS:.o=.c)
32 #CFLAGS=-g -I.. -Ilibevent -Wall -Wstrict-prototypes -pedantic -D_GNU_SOURCE -DVERSION=\"$(VERSION)\" -DPREFIX=\"$(prefix)\" -I$(SRCBASE)/include
33 CFLAGS=-g -I.. -Ilibevent -Wall -Wstrict-prototypes -D_GNU_SOURCE -DVERSION=\"$(VERSION)\" -DPREFIX=\"$(prefix)\" -I$(SRCBASE)/include
35 TARGETS=l2tpd libl2tp.a handlers
37 all: $(TARGETS)
39 libl2tp.a: $(OBJS)
40 rm -f $@
41 ar -rc $@ $^
42 ranlib $@ || true
44 l2tpd: libl2tp.a libevent/libevent.a
45 $(MAKE) -C handlers
46 $(CC) -o l2tpd -rdynamic $(OBJS) $(EXTRA_LIBS)
48 libevent/libevent.a:
49 test -d libevent || ln -s ../libevent .
50 $(MAKE) -C libevent
52 %.o: %.c
53 $(CC) -c -o $@ $(CFLAGS) $<
55 depend: .depend
57 .depend: $(SRCS)
58 $(CC) -M $(CFLAGS) $^ > .depend
60 handlers:
61 $(MAKE) -C handlers
63 # Release requires GNU tar!!
64 release: FORCE
65 rm -f rp-l2tp-$(VERSION).tar.gz
66 make -C libevent/Doc
67 ./make-release.sh $(VERSION)
68 tar cvhf rp-l2tp-$(VERSION).tar rp-l2tp-$(VERSION)
69 gzip -v -9 rp-l2tp-$(VERSION).tar
71 clean:
72 rm -f *.o *.a *~ .depend
73 rm -f l2tpd
74 $(MAKE) -C handlers clean
75 rm -f libevent/*.o libevent/*.a
77 distclean: clean
78 rm -f Makefile config.cache
79 $(MAKE) -C handlers distclean
81 -include .depend
83 install: all
84 -mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)$(sbindir)
85 $(install) -m 755 -s l2tpd $(RPM_INSTALL_ROOT)$(DESTDIR)$(sbindir)
86 -mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)/etc/l2tp
87 $(install) -m 644 l2tp.conf $(RPM_INSTALL_ROOT)$(DESTDIR)/etc/l2tp/l2tp.conf.example
88 -mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)$(mandir)/man8
89 -mkdir -p $(RPM_INSTALL_ROOT)$(DESTDIR)$(mandir)/man5
90 $(install) -m 644 man/l2tpd.8 $(RPM_INSTALL_ROOT)$(DESTDIR)$(mandir)/man8
91 $(install) -m 644 man/l2tp.conf.5 $(RPM_INSTALL_ROOT)$(DESTDIR)$(mandir)/man5
93 $(MAKE) -C handlers install
95 FORCE:
97 .PHONY: handlers
99 .PHONY: FORCE