1 # -*- mode: Makefile -*-
2 # Copyright (C) 2002 by its various Authors, see CVS-log
4 # PURPOSE OF THIS FILE: Make file for OpenH323 Gatekeeper
6 # - Automatic Version Information via RCS:
7 # $Id: Makefile.in,v 1.24 2006/07/06 18:25:19 willamowius Exp $
8 # $Source: /cvsroot/openh323gk/openh323gk/Makefile.in,v $
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 2 of the License, or
13 # (at your option) any later version.
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write to the Free Software
22 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 SOURCES = main.cxx singleton.cxx job.cxx yasocket.cxx h323util.cxx \
27 Toolkit.cxx SoftPBX.cxx GkStatus.cxx RasTbl.cxx Routing.cxx \
28 Neighbor.cxx GkClient.cxx gkauth.cxx RasSrv.cxx ProxyChannel.cxx \
29 gk.cxx version.cxx gkacct.cxx gktimer.cxx gkconfig.cxx \
30 sigmsg.cxx clirw.cxx cisco.cxx ipauth.cxx statusacct.cxx \
31 syslogacct.cxx capctrl.cxx @SOURCES@
33 HEADERS = GkClient.h GkStatus.h Neighbor.h ProxyChannel.h RasPDU.h \
34 RasSrv.h RasTbl.h Routing.h SoftPBX.h Toolkit.h factory.h \
35 gk.h gk_const.h gkacct.h gkauth.h job.h name.h rasinfo.h rwlock.h \
36 singleton.h slist.h stl_supp.h version.h yasocket.h gktimer.h \
37 gkconfig.h configure Makefile sigmsg.h clirw.h cisco.h ipauth.h \
38 statusacct.h syslogacct.h capctrl.h @HEADERS@
40 # add cleanup files for non-default targets
41 CLEAN_FILES += $(OBJDIR)/addpasswd $(OBJDIR)/addpasswd.o docs/manual/*.html
42 # add cleanup files for autoconf
43 #CLEAN_FILES += Makefile config.*
45 # colon, the empty variable and a single space are special characters to
46 # MAKE and may cause trouble. Let's 'quote' the little bastards by
47 # assigning it to a variable
51 space:=$(empty) $(empty)
53 # remove half updated or corrupt files
56 # setup various important paths
58 OPENH323DIR=@OPENH323DIR@
59 OPENH323MAKEDIR=@OPENH323MAKEDIR@
65 ifeq (@NEEDOPENH323PREFIX@,1)
67 PREFIX=@OPENH323INSTALLPREFIX@
74 # having an own idea about default targets. This leads to nicly
75 # maintainable binaries with proper library dependence, libraries may be
76 # replaced on the fly.
77 .PHONY: bothdepend bothshared gkdefault
79 gkdefault: bothdepend bothshared
81 # LD_RUN_LIST is the list form of the LD_RUN_PATH
82 LD_RUN_LIST := $(subst $(colon),$(space),$(LD_RUN_PATH))
83 LD_RUN_LIST += $(PWLIBDIR)/lib $(OPENH323DIR)/lib
85 # compiler/linker flags set by configure script
86 STDCCFLAGS += @STDCCFLAGS@
88 ENDLDLIBS += @ENDLDLIBS@
89 ENDLDFLAGS += @ENDLDFLAGS@
91 STDCCFLAGS += -D'MANUFACTURER=@MANUFACTURER@'
92 STDCCFLAGS += -D'PROGRAMMNAME=@PROGRAMNAME@'
94 # automatically include debugging code or not
96 STDCCFLAGS += -DPASN_NOPRINT
98 STDCCFLAGS += -DPTRACING
102 ### Including the general make rules of OpenH323
105 include $(OPENH323MAKEDIR)/openh323u.mak
107 ### Remove -fdata-sections gcc option that cause problems during link step
108 temp_STDCCFLAGS := $(subst -fdata-sections,,$(STDCCFLAGS))
109 STDCCFLAGS = $(temp_STDCCFLAGS)
111 # GK version infomation
112 STDCCFLAGS += -DMAJOR_VERSION=@GNUGK_MAJOR_VERSION@ -DMINOR_VERSION=@GNUGK_MINOR_VERSION@ -DBUILD_NUMBER=@GNUGK_BUILD_NUMBER@
116 # special dependency to ensure version.cxx is rebuilt each time gnugk is recompiled
117 # so the proper build timestamp is included
118 versionts.h: $(subst version.cxx,,$(SOURCES)) $(HEADERS) $(OH323_LIBDIR)/$(OH323_FILE) $(PW_LIBDIR)/$(PTLIB_FILE)
122 addpasswd: $(OBJDIR)/addpasswd.o
123 $(CXX) -o $(OBJDIR)/addpasswd $(CFLAGS) $(OBJDIR)/addpasswd.o $(LDFLAGS) -l$(PTLIB_BASE)$(LIB_TYPE) $(ENDLDLIBS) $(ENDLDFLAGS)
126 $(MAKE) -C docs/manual html
128 install: install-addpasswd
130 install-addpasswd: addpasswd
131 $(INSTALL) $(OBJDIR)/addpasswd $(INSTALLBIN_DIR)
134 # By this command the build number may be incremented
138 # Use this to increment the build number
140 -@BN=@GNUGK_BUILD_NUMBER@; \
141 BNN=`expr "$$BN" + 1`; \
142 echo "Upgrading from build $$BN to $$BNN"; \
143 cp version.h $(TMP)/version.h; \
144 sed -e 's/BUILD_NUMBER.*'"$$BN"'/BUILD_NUMBER '"$$BNN/" \
145 $(TMP)/version.h > version.h; \
146 rm -f $(TMP)/version.h; \
147 echo "Rerunning configure utility"; \
150 # special configure dependencies
151 configure: configure.in
154 Makefile: Makefile.in config.status
157 config.status: configure
158 ./config.status --recheck