~ubuntu-branches/ubuntu/raring/sip-tester/raring

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Bazaar Package Importer
  • Author(s): ARAKI Yasuhiro
  • Date: 2005-04-11 11:53:53 UTC
  • Revision ID: james.westby@ubuntu.com-20050411115353-o33qn3noyjwjgnpd
Tags: upstream-1.1rc1
ImportĀ upstreamĀ versionĀ 1.1rc1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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.
 
5
#
 
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.
 
10
#
 
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
 
14
#
 
15
#  Copyright (C) 2003 - The Authors
 
16
#
 
17
#  Author : Richard GAYRAUD - 04 Nov 2003
 
18
#           From Hewlett Packard Company.
 
19
#
 
20
 
 
21
# Output binary to be built
 
22
OUTPUT=sipp
 
23
 
 
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 \
 
26
     actions.o variables.o
 
27
 
 
28
# Libraries directories
 
29
LIBDIR_linux=
 
30
LIBDIR_FreeBSD=
 
31
LIBDIR_hpux=
 
32
LIBDIR_tru64=
 
33
LIBDIR_SunOS=
 
34
LIBDIR_Cygwin=
 
35
 
 
36
# Archive file created in your home directory when building the archive target
 
37
# ARCHIVE= $(HOME)/$(OUTPUT).tgz
 
38
ARCHIVE= $(OUTPUT).tgz
 
39
 
 
40
# Files to be erased by 'make clean' in addition to the output 
 
41
# binaries and object files:
 
42
TOCLEAN= *.log $(ARCHIVE) \
 
43
         *.csv *.exe
 
44
 
 
45
###################################################################
 
46
# Generic Rules
 
47
 
 
48
#OSNAME=`uname`
 
49
#MODELNAME=`uname -m`
 
50
 
 
51
# SYSTEM nickname
 
52
SYSTEM_HP-UX=hpux
 
53
SYSTEM_Linux=linux
 
54
SYSTEM_FreeBSD=freebsd
 
55
SYSTEM_OSF1=tru64
 
56
SYSTEM_SunOS=SunOS
 
57
SYSTEM_CYGWIN=Cygwin
 
58
SYSTEM=$(SYSTEM_$(OSNAME))
 
59
 
 
60
# C compiler
 
61
CC_hpux=aCC
 
62
CC_linux=cc  
 
63
CC_freebsd=cc  
 
64
CC_tru64=cc  
 
65
CC_SunOS=gcc
 
66
CC_Cygwin=cc  
 
67
CC=$(CC_$(SYSTEM))
 
68
 
 
69
# C++ compiler mapping
 
70
CPP_hpux=aCC  
 
71
CPP_linux=gcc  
 
72
CPP_freebsd=g++  
 
73
CPP_tru64=cxx  
 
74
CPP_SunOS=g++
 
75
CPP_Cygwin=g++  
 
76
CPP=$(CPP_$(SYSTEM))
 
77
 
 
78
#Model specific flags
 
79
MFLAGS_ia64=+DD64
 
80
MFLAGS_9000/800=+DAportable
 
81
MFLAGS_9000/785=+DAportable
 
82
MFLAGS_i686=
 
83
MFLAGS_i586=
 
84
MFLAGS_i486=
 
85
MFLAGS_i386=
 
86
MFLAGS=$(MFLAGS_$(MODELNAME))
 
87
 
 
88
#C Compiler Flags
 
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
 
95
CFLAGS_SunOS=-g
 
96
CFLAGS_Cygwin=-D__CYGWIN -Dsocklen_t=int
 
97
CFLAGS=$(CFLAGS_$(SYSTEM)) -D__3PCC__ $(TLS)
 
98
 
 
99
#C++ Compiler Flags
 
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
 
104
CPPFLAGS_SunOS=-g
 
105
CPPFLAGS_Cygwin=-D__CYGWIN -Dsocklen_t=int
 
106
CPPFLAGS=$(CPPFLAGS_$(SYSTEM)) -D__3PCC__ $(TLS)
 
107
 
 
108
#Linker mapping
 
109
CCLINK_hpux=aCC
 
110
CCLINK_linux=gcc
 
111
CCLINK_freebsd=g++
 
112
CCLINK_tru64=cxx
 
113
CCLINK_SunOS=gcc
 
114
CCLINK_Cygwin=g++
 
115
CCLINK=$(CCLINK_$(SYSTEM))
 
116
 
 
117
#Linker Flags
 
118
LFLAGS_hpux=-AA -mt
 
119
LFLAGS_linux=
 
120
LFLAGS_freebsd=
 
121
LFLAGS_tru64=
 
122
LFLAGS_SunOS=
 
123
LFLAGS_Cygwin=
 
124
LFLAGS=$(LFLAGS_$(SYSTEM))
 
125
 
 
126
#Link Libraries
 
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))
 
134
 
 
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)) 
 
143
 
 
144
# Building without TLS and authentication (no openssl pre-requisite)
 
145
all:
 
146
        make OSNAME=`uname|sed -e "s/CYGWIN.*/CYGWIN/"` MODELNAME=`uname -m` $(OUTPUT)
 
147
 
 
148
# Building with TLS and authentication
 
149
ossl:
 
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)
 
151
 
 
152
$(OUTPUT): $(OBJ_TLS) $(OBJ)
 
153
        $(CCLINK) $(LFLAGS) $(MFLAGS) $(LIBDIR_$(SYSTEM)) \
 
154
        $(DEBUG_FLAGS) -o $@ $(OBJ_TLS) $(OBJ) $(LIBS) $(TLS_LIBS)
 
155
 
 
156
debug:
 
157
        DEBUG_FLAGS="-g -pg" ; export DEBUG_FLAGS ; make all
 
158
 
 
159
debug_tls:
 
160
        @DEBUG_FLAGS=-g ; export DEBUG_FLAGS ; make tls
 
161
 
 
162
clean:
 
163
        rm -f *.o $(OUTPUT) *~ $(TOCLEAN) 
 
164
        rm -rf cxx_repository
 
165
 
 
166
archive:
 
167
        rm -f TMP_TAR_FILE.* $(ARCHIVE)
 
168
        make clean
 
169
        tar cf TMP_TAR_FILE.tar .
 
170
        gzip TMP_TAR_FILE.tar
 
171
        cp TMP_TAR_FILE.tar.gz $(ARCHIVE)
 
172
        rm -f TMP_TAR_FILE.*
 
173
 
 
174
 
 
175
# Files types rules
 
176
.SUFFIXES: .o .cpp .c .h .hpp
 
177
 
 
178
*.o: *.h *.hpp
 
179
 
 
180
.C.o:
 
181
        $(CPP) $(CPPFLAGS) $(MFLAGS) $(DEBUG_FLAGS) $(INCDIR) -c -o $*.o $<
 
182
 
 
183
.cpp.o:
 
184
        $(CPP) $(CPPFLAGS) $(MFLAGS) $(DEBUG_FLAGS) $(INCDIR) -c -o $*.o $<
 
185
 
 
186
.c.o:
 
187
        $(CC) $(CFLAGS) $(MFLAGS) $(DEBUG_FLAGS) $(INCDIR) -c -o $*.o $<
 
188