Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
128 lines (104 loc) · 3.17 KB
/
Copy pathMakefile
File metadata and controls
128 lines (104 loc) · 3.17 KB
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# You can define several symbols to alter the final executable that gets
# built. Simply define the symbol(s) on the command line like so:
#
# $ make SYMBOL=1 [...]
#
# Symbol Description
#
# DEBUG The project is, by default, built without debugging
# features enabled. Not defining this symbol does several
# things: assert() macros aren't compiled and compiler
# optimization levels are increased.
#
# NO_REPORT If this symbol is defined, none of the report
# generating code is compiled into the executable.
#
# PROFILE Enable profiling code to be added. Also invokes
# NO_DAEMON.
#
# NO_DAEMON Builds an ACNETD that doesn't become a background
# task.
#
# NO_SWAP Doesn't swap bytes when packets are sent or received
# over the network. All ACNET nodes on a network need to
# be built the same way with respect to this option.
#
# PINGER Compile in the internal task that occasionally
# pings nodes to which it's replying.
#
# KEEP_ALIVE Enables the request timeout code. Requests now require
# timely replies to avoid being timed-out. If a reply
# isn't sent, acnetd will send an ACNET_PEND to keep the
# request alive.
#
THIS_PLATFORM:= $(shell uname -s)
THIS_ARCH:= $(shell uname -p)
ACNETD= acnetd
ACNETD_OBJS= main.o taskinfo.o inttask.o exttask.o mctask.o lcltask.o remtask.o \
taskpool.o ipaddr.o network.o acnaux.o reqinfo.o rpyinfo.o \
mcast.o global.o rad50.o node.o timesensitive.o tcpclient.o \
rawhandler.o wshandler.o
VALIDATOR= validator
VALIDATOR_OBJS= regression.o global.o rad50.o
TARGETS= ${ACNETD}
#-I../../uls/ul_acnetd -L../../uls/ul_acnetd
CFLAGS+= -pipe -W -Wall -Werror -I/usr/include/openssl -fno-strict-aliasing\
-DTHIS_PLATFORM=\"${THIS_PLATFORM}\" -DTHIS_ARCH=\"${THIS_ARCH}\" \
-DTHIS_TARGET=${THIS_PLATFORM}_Target -Wno-deprecated-declarations \
-std=c++0x
ifdef NO_REPORT
CFLAGS+= -DNO_REPORT
endif
ifdef PINGER
CFLAGS+= -DPINGER
endif
ifdef DEBUG
CFLAGS+= -DDEBUG -g -O0
else
CFLAGS+= -O2 -DNDEBUG
endif
ifdef PROFILE
CFLAGS+= -pg -DPROFILE -DNO_DAEMON -fprofile
else
ifdef NO_DAEMON
CFLAGS+= -DNO_DAEMON
endif
endif
ifdef NO_SWAP
CFLAGS+= -DNO_SWAP
endif
ifdef KEEP_ALIVE
CFLAGS+= -DKEEP_ALIVE
endif
CXXFLAGS+= ${CFLAGS} ${APPEND_CFLAGS}
# --- Dynamically determine LDFLAGS for OpenSSL using pkg-config ---
PKCONFIG_OPENSSL_LIBS := $(shell pkg-config --libs openssl 2>/dev/null)
ifneq ($(strip $(PKCONFIG_OPENSSL_LIBS)),) # Check if pkg-config command succeeded and produced output
LDFLAGS = $(PKCONFIG_OPENSSL_LIBS) # Use pkg-config output (path to OpenSSL) if available
else # pkg-config failed or didn't find openssl
LDFLAGS = -lcrypto # Fallback to basic -lcrypto
endif
ifeq (${THIS_PLATFORM}, SunOS)
LDFLAGS+= -lresolv -lsocket -lnsl
endif
ifeq (${THIS_PLATFORM}, NetBSD)
LDFLAGS+= -lutil
endif
CXX?= g++
RANLIB?= ranlib
ARCHIVER?= ar
# Target list...
all : ${TARGETS}
TAGS : $(wildcard *.cpp) $(wildcard *.h)
etags -o $@ $^
${ACNETD} : ${ACNETD_OBJS}
${CXX} ${CXXFLAGS} -o $@ $^ ${LDFLAGS}
${VALIDATOR} : ${VALIDATOR_OBJS}
${CXX} ${CXXFLAGS} -o $@ $^ ${LDFLAGS}
${ACNETD_OBJS} : server.h node.h trunknode.h timesensitive.h idpool.h
.PHONY : clean
clean :
@rm -f ${TARGETS} *.o ${VALIDATOR_OBJS} *~
# Local Variables:
# mode:makefile
# End: