1
# This program is free software; you can redistribute it and/or modify
2
# it under the terms of the GNU General Public License as published by
3
# the Free Software Foundation; either version 2 of the License, or
4
# (at your option) any later version.
6
# This program is distributed in the hope that it will be useful,
7
# but WITHOUT ANY WARRANTY; without even the implied warranty of
8
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9
# GNU General Public License for more details.
11
# You should have received a copy of the GNU General Public License
12
# along with this program; if not, write to the Free Software
13
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15
# Copyright (C) 2003 - The Authors
17
# Author : Richard GAYRAUD - 04 Nov 2003
18
# From Hewlett Packard Company.
21
# Output binary to be built
24
# C & C++ object files to be built
25
OBJ= xp_parser.o scenario.o screen.o call.o comp.o sipp.o stat.o \
28
# Libraries directories
36
# Archive file created in your home directory when building the archive target
37
# ARCHIVE= $(HOME)/$(OUTPUT).tgz
38
ARCHIVE= $(OUTPUT).tgz
40
# Files to be erased by 'make clean' in addition to the output
41
# binaries and object files:
42
TOCLEAN= *.log $(ARCHIVE) \
45
###################################################################
54
SYSTEM_FreeBSD=freebsd
58
SYSTEM=$(SYSTEM_$(OSNAME))
69
# C++ compiler mapping
80
MFLAGS_9000/800=+DAportable
81
MFLAGS_9000/785=+DAportable
86
MFLAGS=$(MFLAGS_$(MODELNAME))
89
# supress warning #829 (Implicit conversion of string literal to
90
#'char *' is deprecated) since this is both common and harmless
91
CFLAGS_hpux=-D__HPUX -DPROTOTYPES +W829
92
CFLAGS_linux=-D__LINUX -pthread
93
CFLAGS_freebsd=-D__LINUX -pthread
94
CFLAGS_tru64=-D__OSF1 -pthread
96
CFLAGS_Cygwin=-D__CYGWIN -Dsocklen_t=int
97
CFLAGS=$(CFLAGS_$(SYSTEM)) -D__3PCC__ $(TLS)
100
CPPFLAGS_hpux=-AA -mt -D__HPUX +W829
101
CPPFLAGS_linux=-D__LINUX -pthread
102
CPPFLAGS_freebsd=-D__LINUX -pthread
103
CPPFLAGS_tru64=-D__OSF1 -pthread
105
CPPFLAGS_Cygwin=-D__CYGWIN -Dsocklen_t=int
106
CPPFLAGS=$(CPPFLAGS_$(SYSTEM)) -D__3PCC__ $(TLS)
115
CCLINK=$(CCLINK_$(SYSTEM))
124
LFLAGS=$(LFLAGS_$(SYSTEM))
127
LIBS_linux= -ldl -lpthread -lcurses -lstdc++
128
LIBS_hpux= -lcurses -L /opt/openssl/lib
129
LIBS_tru64= -lcurses -lpthread
130
LIBS_freebsd= -lcurses -pthread
131
LIBS_SunOS= -lcurses -lpthread -lnsl -lsocket -lstdc++ -ldl -L /usr/local/ssl/lib/
132
LIBS_Cygwin= -lcurses -lpthread -lstdc++
133
LIBS=$(LIBS_$(SYSTEM))
135
# Include directories
136
INCDIR_linux=-I. -I/opt/openssl/include
137
INCDIR_freebsd=-I. -I/opt/openssl/include
138
INCDIR_hpux=-I. -I/opt/openssl/include
139
INCDIR_tru64=-I. -I/opt/openssl/include
140
INCDIR_SunOS=-I. -I/usr/local/ssl/include/
141
INCDIR_Cygwin=-I. -I/usr/include/openssl -I/usr/include
142
INCDIR=$(INCDIR_$(SYSTEM))
144
# Building without TLS and authentication (no openssl pre-requisite)
146
make OSNAME=`uname|sed -e "s/CYGWIN.*/CYGWIN/"` MODELNAME=`uname -m` $(OUTPUT)
148
# Building with TLS and authentication
150
make OSNAME=`uname|sed -e "s/CYGWIN.*/CYGWIN/"` MODELNAME=`uname -m` OBJ_TLS="auth.o sslinit.o sslthreadsafe.o" TLS_LIBS="-lssl -lcrypto" TLS="-D_USE_OPENSSL -DOPENSSL_NO_KRB5" $(OUTPUT)
152
$(OUTPUT): $(OBJ_TLS) $(OBJ)
153
$(CCLINK) $(LFLAGS) $(MFLAGS) $(LIBDIR_$(SYSTEM)) \
154
$(DEBUG_FLAGS) -o $@ $(OBJ_TLS) $(OBJ) $(LIBS) $(TLS_LIBS)
157
DEBUG_FLAGS="-g -pg" ; export DEBUG_FLAGS ; make all
160
@DEBUG_FLAGS=-g ; export DEBUG_FLAGS ; make tls
163
rm -f *.o $(OUTPUT) *~ $(TOCLEAN)
164
rm -rf cxx_repository
167
rm -f TMP_TAR_FILE.* $(ARCHIVE)
169
tar cf TMP_TAR_FILE.tar .
170
gzip TMP_TAR_FILE.tar
171
cp TMP_TAR_FILE.tar.gz $(ARCHIVE)
176
.SUFFIXES: .o .cpp .c .h .hpp
181
$(CPP) $(CPPFLAGS) $(MFLAGS) $(DEBUG_FLAGS) $(INCDIR) -c -o $*.o $<
184
$(CPP) $(CPPFLAGS) $(MFLAGS) $(DEBUG_FLAGS) $(INCDIR) -c -o $*.o $<
187
$(CC) $(CFLAGS) $(MFLAGS) $(DEBUG_FLAGS) $(INCDIR) -c -o $*.o $<