2 bindir = $(PREFIX
)/usr
/sbin
3 etcdir
= $(PREFIX
)/etc
/l2tpns
4 libdir = $(PREFIX
)/usr
/lib
/l2tpns
10 INSTALL
= /usr
/bin
/install -c
31 all: l2tpns cluster_master nsctl
$(PLUGINS
)
34 $(CC
) $(CFLAGS
) -o
$@
$^
$(LIBS
) $(DEFS
)
36 cluster_master
: cluster_master.o ll.o cluster.o util.o
37 $(CC
) $(CFLAGS
) -o
$@
$^
$(DEFS
)
39 nsctl
: nsctl.o control.o
40 $(CC
) $(CFLAGS
) -o
$@
$^
$(DEFS
)
43 /bin
/rm -f
*.o
*.so l2tpns cluster_master nsctl
46 $(INSTALL
) -D
-o root
-g root
-m
0755 l2tpns
$(bindir)/l2tpns
47 $(INSTALL
) -D
-o root
-g root
-m
0755 cluster_master
$(bindir)/cluster_master
48 $(INSTALL
) -D
-o root
-g root
-m
0755 nsctl
$(bindir)/nsctl
49 $(INSTALL
) -D
-o root
-g root
-m
0600 etc
/l2tpns.cfg.default
$(etcdir
)/l2tpns.cfg
50 $(INSTALL
) -D
-o root
-g root
-m
0644 etc
/ip_pool.default
$(etcdir
)/l2tpns.ip_pool
51 $(INSTALL
) -D
-o root
-g root
-m
0600 etc
/users.default
$(etcdir
)/l2tpns.users
52 for PLUGIN in
$(PLUGINS
); do \
53 $(INSTALL
) -o root
-g root
-m
0755 $(PLUGIN
) $(libdir)/$(PLUGIN
); \
55 if
[ ! -e
/dev
/net
/tun
]; then \
57 mknod
/dev
/net
/tun c
10 200; \
61 $(CC
) -fPIC
-shared
-o
$@
$^
$(LDFLAGS
) $(LIBS
) $(LIBPATH
)