NSIS-ka
A free C++ implementation of NSIS protocols

source: ntlp/branches/20080714-mobility/src/Makefile @ 4560

Last change on this file since 4560 was 3324, checked in by hiwi-laier, 9 years ago
  • Make it possible to build qosnslp w/o mip6d installed (i.e. no flowinfoservice)
  • Make the main flowinfo thread loop more fault resistant, try to (re)connect in case the mip6d UDS shuts down or is not available at the time the flowinfoservice starts
  • Add overhead and tunnel_id information

3/3

  • Property svn:keywords set to URL Rev Author
File size: 8.1 KB
Line 
1# -----------------------------------*- mode: Makefile; -*--
2# Makefile - Makefile for GIST/NTLP
3# ----------------------------------------------------------
4# $Id$
5# $HeadURL: ntlp/branches/20080714-mobility/src/Makefile $
6# ==========================================================
7#                     
8# (C)opyright, all rights reserved by
9# - Institute of Telematics, University of Karlsruhe (TH)
10# ==========================================================
11#
12# The following Makefile variables may be used:
13#     LOGGING        Enable logging output (default: active)
14#     DEBUGGING      Enable debugging (default: active)
15#     OPTIMIZATION   Optimize using the given flags (default: '')
16#
17# Don't forget to run "make clean" before changing these variables!
18# An example for building without debugging but with logging support and
19# optimization:
20#
21#     make DEBUGGING= LOGGING=1 OPTIMIZATION=-O2
22#
23
24DISTDIR?=$(CURDIR)/../..
25include $(DISTDIR)/Makefile.inc
26
27DEBUGGING       = 1                     # the undefined value disables debugging
28LOGGING         = 1                     # the undefined value disables logging
29OPTIMIZATION    =                       # ie. -O2
30
31ifdef DEBUGGING
32GIST_CXXFLAGS   += -g -D_DEBUG
33endif
34
35ifndef LOGGING
36GIST_CXXFLAGS   += -D_NO_LOGGING
37endif
38
39GIST_CXXFLAGS   += $(OPTIMIZATION)
40
41
42
43#SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
44#ARCH := $(SUBARCH)
45
46#export UNAME_MACHINE := "$(ARCH)"
47
48include ../GIST-KA-RELEASE
49
50#CFLAGS         = -pg -Wuninitialized -Wall $(GIST_CXXFLAGS) # profiling
51#CFLAGS         = -s -finline-functions -O3 -Wuninitialized -Wall $(GIST_CXXFLAGS) # optimization
52#CFLAGS         = --pedantic -O -Wno-long-long -Wuninitialized -Wall $(GIST_CXXFLAGS) # optimized
53#CFLAGS         = --pedantic -g -Wno-long-long -Wall $(GIST_CXXFLAGS) # development
54#CFLAGS         = --pedantic -O2 -g -Wno-long-long -Wall $(GIST_CXXFLAGS) # development (valgrind)
55CFLAGS          = --pedantic -Wno-long-long -Wall $(GIST_CXXFLAGS) -D GIST_VSTR=\"$(GIST_RELEASE)\"
56CFLAGS         += -Wno-deprecated -Werror
57
58CLINK           = -c -o
59CC              = gcc
60CPP             = g++
61RM              = rm -f
62
63NTLPEXE         = gistka
64
65TARGETS = $(NTLPEXE) test_objectpool libs
66
67PDUDIR=pdu
68
69NTLP_PDUSRC  := $(wildcard $(PDUDIR)/*.cpp)
70NTLP_PDUOBJS := $(patsubst %.cpp,%.o,$(NTLP_PDUSRC))
71
72TMP_NTLP_SRCS =  $(wildcard *.cpp) $(NTLP_PDUSRC)
73ifndef USE_FLOWINFO
74NTLP_SRCS = $(filter-out flowinfo.cpp, $(TMP_NTLP_SRCS))
75else
76NTLP_SRCS = $(TMP_NTLP_SRCS)
77CFLAGS += $(FLOWINFO_CFLAGS)
78endif
79NTLP_OBJS=  $(patsubst %.cpp,%.o,$(NTLP_SRCS))
80
81DEPENDFILE := $(wildcard dependfile)
82
83GISTLIB=libGIST.a
84GISTLIB_SHARED=libGIST.so
85
86ifdef SCTP_DIR
87GNOME_LIBDIR    = /opt/gnome/lib
88SCTP_INC        = $(SCTP_DIR)/sctplib/sctp
89SCTP_INCLUDE    = -I$(SCTP_INC)
90SCTP_LIBDIR     = $(SCTP_DIR)/sctplib/sctp/.libs
91SCTP_LIB        = $(SCTP_LIBDIR)/libsctplib.a
92SCTP_LIBSEARCH  = -L$(SCTP_LIBDIR) -L$(GNOME_LIBDIR)
93SCTP_LIBLD      = -lsctplib -lgtk -lgdk
94SCTP_OPTIONS    = -D_USE_SCTP
95CFLAGS          += $(SCTP_OPTIONS)
96PROTLIB_MAKEFLAGS += SCTP_DIR=$(SCTP_DIR)
97endif
98
99ifdef SCTP_KERN
100SCTP_LIBLD      = -lsctp
101SCTP_OPTIONS    = -D_USE_SCTP
102CFLAGS          += $(SCTP_OPTIONS)
103PROTLIB_MAKEFLAGS += SCTP_KERN=yo
104endif
105
106# QT_DIR=/usr/lib/qt3
107ifdef QT_DIR
108GUI_OPTIONS     = -D_GUI
109GUI_QTINC       = $(QT_DIR)/include
110GUI_INC         = gui/include
111GUI_SRCDIR      = gui/src
112GUI_INCLUDE     = -I$(GUI_INC) -I$(GUI_QTINC)
113GUI_QTLIBDIR      = $(QT_DIR)/lib
114GUI_LIBSEARCH   = -L$(GUI_QTLIBDIR)
115CFLAGS          += $(GUI_OPTIONS)
116QTLIBFLAG               = -lqt
117endif
118
119LIBS            = $(PROTLIB_LIB) $(FQUEUE_LIB) $(SCTP_LIB) # use with SCTP
120#LIBS           = $(PROTLIB_LIB) $(FQUEUE_LIB)
121
122SHLIBS          = -lrt $(QTLIBFLAG)
123STATIC_LIBS     = -lprot -lipq -lcrypto -lssl -lfastqueue $(SCTP_LIBLD)
124
125API_INC         = ../include
126PDU_INC         = ./pdu
127INCLUDE         = -I. -I$(PDU_INC) -I$(API_INC) -I$(PROTLIB_INC) -I$(FQUEUE_INC) $(SCTP_INCLUDE) $(GUI_INCLUDE)
128LIBDIRS         = -L$(FQUEUE_SRC) -L$(PROTLIB_SRC) $(SCTP_LIBSEARCH) $(GUI_LIBSEARCH)
129
130SUBDIRS = $(PROTLIB_SRC)
131
132.SUFFIXES:      .cpp
133
134
135
136.DEFAULT:
137        @echo "** Oops, now I'm in trouble, because..."
138        @echo "=> Don't know how to make target $<."
139        @echo
140        @echo "HINT: If it's a header file, you may try \"make depend\"".
141        @echo "      Otherwise have a look at"
142        @echo "      `pwd`/Makefile"
143        @false
144
145## ----------------------------------------------------------------------------------------------
146
147all:    protliblib $(GISTLIB) $(NTLPEXE)
148 
149.PHONY: all protliblib
150
151setperms:
152        test -x test_setuid && su -c 'chown root test_setuid ; chmod u+s test_setuid' ; true
153#       test -x test_tp_over_sctp && su -c 'chown root test_tp_over_sctp ; chmod u+s test_tp_over_sctp' ; true
154        test -x test_signaling && su -c 'chown root test_signaling ; chmod u+s test_signaling' ; true
155        test -x simpleclient && su -c 'chown root simpleclient ; chmod u+s simpleclient' ; true
156
157$(NTLPEXE):   ntlp_main.o $(GISTLIB) $(LIBS)
158        $(CPP) $(CFLAGS) -o $@ ntlp_main.o -L . -lGIST $(LIBDIRS) $(SHLIBS) $(STATIC_LIBS) 
159
160$(GISTLIB): $(NTLP_OBJS)
161        ar -rsv $@ $?
162
163$(GISTLIB_SHARED): $(NTLP_OBJS)
164        $(CPP) -shared -o $@ $?
165
166test_flowinfo: test_flowinfo.o $(GISTLIB) $(LIBS)
167        $(CPP) $(CFLAGS) -o $@ $^  -L . -lGIST $(LIBDIRS) $(SHLIBS) $(STATIC_LIBS)
168
169simpleclient: simpleclient.o
170        $(CPP) $(CFLAGS) -o $@ $^ $(LIBDIRS) $(SHLIBS) $(STATIC_LIBS)
171
172test_api_send: test_api_send.o
173        $(CPP) $(CFLAGS) -o $@ $(NTLP_OBJS) $^ $(LIBDIRS) $(SHLIBS) $(STATIC_LIBS)
174
175simpleclientUDPdummy: simpleclientUDPdummy.o
176        $(CPP) $(CFLAGS) -o $@ $(NTLP_OBJS) $^ $(LIBDIRS) $(SHLIBS) $(STATIC_LIBS)
177
178
179simpleclientQE: simpleclientQE.o
180        $(CPP) $(CFLAGS) -o $@ $^ $(LIBDIRS) $(SHLIBS) $(STATIC_LIBS)
181
182simpleclientNTLP: simpleclientNTLP.o
183        $(CPP) $(CFLAGS) -o $@ $(NTLP_OBJS) $^ $(LIBDIRS) $(SHLIBS) $(STATIC_LIBS)
184
185
186tests: libs test_log test_objectpool test_timer test_threads test_refcount\
187        test_ie test_fqueue test_timer_module test_setuid test_tp_over_tcp\
188        test_prefixmap test_signaling
189
190test_log: test_log.o logfile.o
191        $(CPP) $(CFLAGS) -o $@ $^ $(SHLIBS)
192
193test_prefixmap: test_prefixmap.o threadsafe_db.o logfile.o libie.a
194        $(CPP) $(CFLAGS) -o $@ $^ $(SHLIBS)
195
196test_objectpool: test_objectpool.o test_util.o objectpool.o logfile.o # fqueue.o $(FQUEUE_LIB)
197        $(CPP) $(CFLAGS) -o $@ $^ $(SHLIBS)
198
199test_fqueue: test_fqueue.o test_util.o fqueue.o logfile.o $(FQUEUE_LIB)
200        $(CPP) $(CFLAGS) -o $@ $^ $(SHLIBS)
201
202test_timer: test_timer.o timer.o logfile.o # fqueue.o $(FQUEUE_LIB)
203        $(CPP) $(CFLAGS) -o $@ $^ $(SHLIBS)
204
205test_threads: test_threads.o threads.o logfile.o # fqueue.o $(FQUEUE_LIB)
206        $(CPP) $(CFLAGS) -o $@ $^ $(SHLIBS)
207
208test_refcount: test_refcount.o refcount.o logfile.o
209        $(CPP) $(CFLAGS) -o $@ $^ $(SHLIBS)
210
211test_ie: test_ie.o threadsafe_db.o logfile.o test_util.o libie.a
212        $(CPP) $(CFLAGS) -o $@ $^ $(SHLIBS)
213
214test_setuid: test_setuid.o setuid.o threadsafe_db.o logfile.o
215        $(CPP) $(CFLAGS) -o $@ $^ $(SHLIBS)
216
217test_send_pdu: test_send_pdu.o $(PROTLIB) $(LIBS)
218        $(CPP) $(CFLAGS) -o $@ $^ $(SHLIBS) $(NTLP_OBJS)
219
220
221
222libs:   $(LIBS)
223
224# always checks for new things in protlib subdirs
225protliblib:
226                $(MAKE) -C $(PROTLIB_SRC) -$(MAKEFLAGS) $(PROTLIB_MAKEFLAGS)
227
228$(PROTLIB_LIB): 
229                $(MAKE) -C $(PROTLIB_SRC) -$(MAKEFLAGS) $(PROTLIB_MAKEFLAGS) $(@F)
230
231$(FQUEUE_LIB): 
232                $(MAKE) -C $(FQUEUE_DIR) -$(MAKEFLAGS)
233
234$(SCTP_LIB):
235        $(MAKE) -C $(SCTP_DIR) -$(MAKEFLAGS)
236
237clean: 
238                $(RM) $(PDUDIR)/*.o *.o *~ \#*\# core $(INC)/*~ $(GISTLIB) $(GISTLIB_SHARED)
239
240dellogs: 
241                $(RM) *.log
242
243distclean:      clean dellogs
244                $(RM) $(TARGETS)
245                $(RM) -r cxx_repository
246                $(RM) so_locations
247
248clobber:        distclean
249
250freshdepend: depend
251
252# depend: *.cpp ../include/*.h
253depend:
254        $(CPP) -MM $(NTLP_SRCS) $(INCLUDE) > dependfile
255
256dependfile:
257ifneq ($(DEPENDFILE),dependfile)
258        $(CPP) -MM $(NTLP_SRCS) $(INCLUDE) > dependfile
259endif
260
261TAGS:
262        - etags --language=c++ $(INC)/*.h $(NTLP_SRCS) $(PROTLIB_INC)/*.h $(PROTLIB_SRC)/*.cpp
263
264
265ls:             
266                @ls -x --width=60 $(NTLP_SRCS) > .ls.tmp
267                @cat .ls.tmp |  sed s/\ /\ /g | sed s/\ \ /\ /g  > .ls.sed.tmp
268                @echo ""
269                @cat .ls.sed.tmp | sed s/\ \ /\ /g
270                @echo ""
271                @cat .ls.sed.tmp | sed s/\ \ /\ /g | sed s/\.cpp/\.o/g
272                @echo ""
273                @rm -f .ls.tmp .ls.sed.tmp
274
275
276#compile rules
277
278%.o:            %.cpp
279                $(RM) $@
280                $(CPP) $(CFLAGS) $(CLINK) $@ $(INCLUDE) $<
281
282#rule for Qt moc files (to process signals/slots/Q_OBJECT)
283moc_%.cpp: %.h
284           moc $< -o $@
285
286
287.PHONY: clean distclean dellogs clobber setperms TAGS depend dependfile
288
289### DO NOT DELETE THIS LINE -- make depend depends on it.
290-include dependfile
Note: See TracBrowser for help on using the repository browser.