-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.in
109 lines (85 loc) · 2.95 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#
# Copyright (c) 2009-2011, Adrian Thurston <[email protected]>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
LDFLAGS = @LDFLAGS@
CXXFLAGS += -g -Wall
CC_SRCS = main.cc parser.cc string.cc rcfile.cc encrypt.cc \
log.cc db.cc tls.cc base64.cc test.cc broadcast.cc queue.cc \
friendreq.cc prefriend.cc message.cc network.cc notification.cc user.cc \
login.cc flogin.cc identity.cc connect.cc keys.cc conversion.cc server.cc \
packet.cc umessage.cc listenfork.cc keyagent.cc barrier.cc command.cc
GEN_SRCS = packet.cc parser.cc rcfile.cc base64.cc schema.h umessage.cc command.cc
LIBS = @LIBS@
LIBS += -lcrypto -ldl
#*************************************
DEFS += \
-DPREFIX='"@prefix@"' \
-DSYSCONFDIR='"@prefix@/etc"' \
-DLOGDIR='"@prefix@/var/log/dsnpd"' \
-DDSNPD_USER='"@DSNPD_USER@"' \
-DDSNPK_USER='"@DSNPK_USER@"' \
-DNOTIF_USER='"@NOTIF_USER@"' \
-DCA_CERT_FILE='"@CA_CERT_FILE@"' \
-DPID_DIR='"@PID_DIR@"' \
-DENABLE_DEBUG=@ENABLE_DEBUG@
prefix = @prefix@
datarootdir = @datarootdir@
BUILD_PARSERS = @BUILD_PARSERS@
EXEEXT = @EXEEXT@
CXX = @CXX@
PID_DIR = @PID_DIR@
# Get objects and dependencies from sources.
OBJS = $(CC_SRCS:%.cc=%.o)
DEPS = $(CC_SRCS:%.cc=.%.d)
# Get the version info.
#include ../version.mk
# Rules.
all: dsnpd
dsnpd: $(GEN_SRCS) $(OBJS)
$(CXX) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
# No automatic dependency computation for Ragel includes.
#parser.cc: common.rl
#packet.cc: common.rl
#umessage.cc: common.rl
#packet.cc: packet.rl
# ragel -G2 -o $@ $<
#parser.cc: parser.rl
# ragel -G2 -o $@ $<
#rcfile.cc: rcfile.rl
# ragel -G2 -o $@ $<
#base64.cc: base64.rl
# ragel -G2 -o $@ $<
#umessage.cc: umessage.rl
# ragel -G2 -o $@ $<
#command.cc: command.rl
# ragel -G2 -o $@ $<
schema.h: Makefile ../schema_version
echo "#ifndef _SCHEMA_VERSION_H" > $@
echo "#define _SCHEMA_VERSION_H" >> $@
echo "#define SCHEMA_VERSION `cat ../schema_version`" >> $@
echo "#endif" >> $@
%.o: %.cc
@$(CXX) -M $(DEFS) $(INCS) $< > .$*.d
$(CXX) -c $(CXXFLAGS) $(DEFS) $(INCS) -o $@ $<
distclean: clean
rm -f Makefile
clean:
rm -f tags .*.d *.o dsnpd $(GEN_SRCS)
install: all
install -d $(DESTDIR)$(prefix)/etc/
install -d $(DESTDIR)$(prefix)/bin
install -d $(DESTDIR)$(prefix)/var/log
install -d $(DESTDIR)$(PID_DIR)
install dsnpd $(DESTDIR)$(prefix)/bin/dsnpd
-include $(DEPS)