-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile.in
66 lines (55 loc) · 1.83 KB
/
Makefile.in
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
SUBDIRS = src/radius src src/modules src/netflow
DESTDIR = @prefix@
NETSPIRE_DIR = $(DESTDIR)@libdir@/netspire
BEAMDIR = $(NETSPIRE_DIR)/ebin
PRIVDIR = $(NETSPIRE_DIR)/priv
SPOOLDIR = $(DESTDIR)@localstatedir@/lib/netspire
SBINDIR = $(DESTDIR)@sbindir@
LOGDIR = $(DESTDIR)@localstatedir@/log/netspire
ETCDIR = $(DESTDIR)@sysconfdir@/netspire
all: checks all-recursive
test -r netspire.app && cp netspire.app ebin
checks:
test -d ebin || mkdir ebin
all-recursive clean-recursive distclean-recursive:
@subdirs="$(SUBDIRS)"; for subdir in $$subdirs; do \
target=`echo $@|sed 's,-recursive,,'`; \
echo making $$target in $$subdir; \
(cd $$subdir && $(MAKE) $$target) || exit 1; \
done
install: all
install -d $(BEAMDIR)
install -m 644 ebin/*.beam $(BEAMDIR)
install -m 644 netspire.app $(BEAMDIR)
install -d -m 750 $(SPOOLDIR)
install -d $(SBINDIR)
install -d $(PRIVDIR)
install -d $(PRIVDIR)/radius
install -m 644 priv/radius/* $(PRIVDIR)/radius
install -d -m 750 $(ETCDIR)
install -m 644 *.conf.sample $(ETCDIR)
install -d -m 750 $(LOGDIR)
sed < netspirectl.in > netspirectl \
-e 's!%%ERL%%!@ERL@!g' \
-e 's!%%SPOOLDIR%%!$(SPOOLDIR)!g' \
-e 's!%%BEAMDIR%%!$(BEAMDIR)!g' \
-e 's!%%ERL%%!@ERL@!g' \
-e 's!%%NETSPIRE_LOG%%!$(LOGDIR)/netspire.log!g' \
-e 's!%%NETSPIRE_CONFIG%%!$(ETCDIR)/netspire.conf!g'
install -m 755 netspirectl $(SBINDIR)
run: all
@ERL@ +W w -pa ebin -mnesia dir \"/tmp/netspire\" -sname netspire \
-netspire config \"netspire.conf\" -netspire logfile \"/tmp/netspire.log\" \
-eval 'application:start(netspire).'
test: all
(cd test && make)
clean: clean-recursive
rm -f erl_crash.dump netspirectl
find . -name "*~" -exec rm -f {} \;
distclean: clean clean-recursive distclean-recursive
rm -f config.status
rm -f config.log
rm -f Makefile
rm -f configure
rm -f erl_crash.dump
rm -rf ebin autom4te.cache