File: ns.mak.in

package info (click to toggle)
aolserver4 4.5.1-18.1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 12,008 kB
  • sloc: ansic: 45,126; tcl: 5,533; sh: 1,037; makefile: 380; pascal: 219; php: 13
file content (256 lines) | stat: -rw-r--r-- 6,890 bytes parent folder | download | duplicates (2)
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
#
# The contents of this file are subject to the AOLserver Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://aolserver.com/.
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is AOLserver Code and related documentation
# distributed by AOL.
# 
# The Initial Developer of the Original Code is America Online,
# Inc. Portions created by AOL are Copyright (C) 1999 America Online,
# Inc. All Rights Reserved.
#
# Alternatively, the contents of this file may be used under the terms
# of the GNU General Public License (the "GPL"), in which case the
# provisions of GPL are applicable instead of those above.  If you wish
# to allow use of your version of this file only under the terms of the
# GPL and not to allow others to use your version of this file under the
# License, indicate your decision by deleting the provisions above and
# replace them with the notice and other provisions required by the GPL.
# If you do not delete the provisions above, a recipient may use your
# version of this file under either the License or the GPL.
# 
#
# $Header: /cvsroot/aolserver/aolserver/include/ns.mak.in,v 1.5 2006/06/27 17:00:55 jgdavidson Exp $

#
# ns.mak.in --
#
#	Makefile include for AOLserver modules, libraries, and programs.  Variables to set
#	before including this file include:
#
#	AOLSERVER	AOLserver install directory
#	DLL		Root name of dynamic library (without lib prefix or extension)
#	OBJS		List of library object files (required with DLL)
#	DLLINIT		Dynamic library entry point
#	DLLLIBS		Extra dynamic library link libraries
#	MOD		Name of module
#	MODOBJS		List of module object files (required with MOD)
#	MODINIT		Module entry point
#	MODLIBS		Extra module link libraries
#	PGM		Name of executable program
#	PGMOBJS		List of program object files (required with PGM)
#	PGMLIBS		Extra program link libraries
#	HDRS		Header files which objects depend on
#	INSTALL		Extra install directive(s)
#	CLEAN		Extra clean directive(s)
#
#	At least one of PGM, MOD, or DLL must be defined.
#
#	See ../nsd/Makefile and ../nsdb/Makefile for examples.
#	

#
# Install directories.
#

AOLSERVER	= @AOLSERVER@
TCLSH		= @TCLSH@
INSTBIN		= $(AOLSERVER)/bin
INSTLIB		= $(AOLSERVER)/lib
INSTINC		= $(AOLSERVER)/include
INSTTCL         = $(AOLSERVER)/modules/tcl
INSTSRV         = $(AOLSERVER)/servers/server1
INSTSRVMOD      = $(INSTSRV)/modules
INSTSRVPAG      = $(INSTSRV)/pages
SH		= /bin/sh

DEBRPATH	= -Wl,-rpath,$(INSTLIB)

#
# Compiler and linker options.
#

LIBEXT		= @TCL_SHLIB_SUFFIX@
LDLIB		= @LDLIB@
LDSO		= @LDSO@ $(DEBRPATH)
CCRFLAG         = @CCRFLAG@
LDRFLAG         = @LDRFLAG@
CCRPATH         += @CCRPATH@ $(DEBRPATH)
LDRPATH         += @LDRPATH@ $(DEBRPATH)
CC		= $(PURIFY) @TCL_CC@
CFLAGS_DEBUG	= @TCL_CFLAGS_DEBUG@
CFLAGS_OPTIMIZE = @TCL_CFLAGS_OPTIMIZE@
CFLAGS_WARNING	= @TCL_CFLAGS_WARNING@
CFLAGS_INCLUDE	= -I$(INCDIR) @TCL_INCLUDE_SPEC@
CFLAGS_EXTRA	= @TCL_SHLIB_CFLAGS@
DEFS      	= -DNO_CONST -DUSE_INTERP_ERRORLINE -DUSE_INTERP_RESULT @TCL_DEFS@ @DEFS@
CFLAGS		+= @CFLAGS_DEFAULT@ $(CFLAGS_WARNING) $(CFLAGS_EXTRA) $(CFLAGS_INCLUDE) @CPPFLAGS@ $(DEFS)
ifndef SRCDIR
    UTILS	 = /usr/share/aolserver4
    LIBS	+= -L/usr/lib/aolserver4/lib -lnsd -lnsthread
    INCDIR	 = /usr/include/aolserver4
else
    UTILS	 = $(SRCDIR)/util
    INCDIR	 = $(SRCDIR)/include
    ifneq (nsthread,$(DLL))
    	ifneq (nsd,$(DLL))
            ifneq (nsthreadtest,$(PGM))
                LIBS += -L$(SRCDIR)/nsd -lnsd
            endif
    	endif
    	LIBS += -L$(SRCDIR)/nsthread -lnsthread
    endif
endif
LIBS		+= @TCL_LIB_SPEC@ @TCL_LIBS@ @LDFLAGS@ @LIBS@
CCLIBS		 = $(LIBS) @TCL_LD_FLAGS@

#
# Shell utilities.
#

RANLIB	  = @TCL_RANLIB@
MAKEALL	  = $(TCLSH) $(UTILS)/nsmakeall.tcl
RM        = $(TCLSH) $(UTILS)/nsremove.tcl
INST	  = $(TCLSH) $(UTILS)/nsinstall.tcl
INSTMAN   = $(SH) $(UTILS)/nsinstall-man.sh -v -s
INSTALL_SH = $(UTILS)/install-sh -c
INSTALL_DATA = $(INSTALL_SH) -m 644

#
# Platform-specific options.
#

uname = $(shell uname -a)

# Solaris 2.6+
ifneq (,$(findstring SunOS,$(uname)))
    ifneq (,$(findstring 5.6,$(uname)))
        LIBS+=-lthread -lposix4
    else
        LIBS+=-lrt
    endif
endif

# Mac OS X
ifneq (,$(findstring Darwin,$(uname)))
    LDFLAGS     += @TCL_EXTRA_CFLAGS@
endif

# Add dynamic library entry point flags.
ifdef DLLINIT
    ifneq (,$(findstring Darwin,$(uname)))
	INIT	 =  _$(DLLINIT)
	LDLIB	+= -init _$(INIT)
    else
	INIT	 =  _init
    endif
endif
 
ifdef MOD
    DLL		 = $(MOD)
    MODBIN	 = $(MOD).so
    BUILD	+= $(MODBIN)
    INSTALL 	+= install-mod
    CLEAN	+= clean-mod
    ifdef MODINIT
	MODSRC	 = $(INCDIR)/nsmodinit.c
	MODOBJ	 = $(MOD)_modinit.o
	MODOBJS	+= $(MODOBJ)
    endif
endif

ifdef DLL
    DLLBIN	 = lib$(DLL)$(LIBEXT)
    DLLLIB	 = lib$(DLL).a
    OBJS	+= $(UNIXOBJS)
    ifdef DLLINIT
	LIBSRC	 = $(INCDIR)/nslibinit.c
	LIBOBJ	 = $(DLL)_libinit.o
    endif
    BUILD	+= $(DLLLIB) $(DLLBIN)
    INSTALL	+= install-dll
    CLEAN  	+= clean-dll
    MODLIBS	+= -L. -l$(DLL)
    PGMLIBS	+= -L. -l$(DLL)
endif

ifdef PGM
    BUILD	+= $(PGM)
    INSTALL	+= install-pgm
    CLEAN	+= clean-pgm
endif

ifdef MAN
    INSTALL	+= install-man install-html
endif

all build: $(BUILD)

install: $(INSTALL)

clean: $(CLEAN)

$(DLLBIN): $(OBJS) $(LIBOBJ)
	$(RM) $(DLLBIN)
	$(LDLIB) $(LDFLAGS) -o $(DLLBIN) $(OBJS) $(LIBOBJ) \
		$(DLLLIBS) $(LIBS) @LDRPATHS@ $(DEBRPATH)

$(DLLLIB): $(OBJS)
	$(AR) rv $(DLLLIB) $(OBJS)
	$(RANLIB) $(DLLLIB)

$(MODBIN): $(MODOBJS) $(DLLBIN)
	$(RM) $(MODBIN)
	$(LDSO) $(LDFLAGS) -o $(MODBIN) $(MODOBJS) $(MODLIBS) $(LIBS) @LDRPATHS@ $(DEBRPATH)

$(MODOBJ): $(MODSRC)
	$(CC) $(CFLAGS) -DNS_MODINIT=$(MODINIT) -c -o $(MODOBJ) $(MODSRC)

$(LIBOBJ): $(LIBSRC)
	$(CC) $(CFLAGS) -DNS_INIT=$(INIT) -DNS_LIBINIT=$(DLLINIT) -c -o $(LIBOBJ) $(LIBSRC)

$(PGM): $(PGMOBJS) $(DLLLIB) $(DLLBIN)
	$(RM) $(PGM)
	$(CC) $(LDFLAGS) -o $(PGM) $(PGMOBJS) \
		$(PGMLIBS) $(CCLIBS) @CCRPATHS@ $(DEBRPATH)

$(MODOBJS) $(OBJS) $(PGMOBJS): $(HDRS) $(INCDIR)/ns.h $(INCDIR)/nsthread.h

install-mod: $(MODBIN)
	$(INST) -d $(INSTBIN) -e $(MODBIN)

install-dll: $(DLLBIN)
	$(INST) -d $(INSTLIB) -e $(DLLBIN)
	$(INST) -d $(INSTLIB) $(DLLLIB) 
	$(RANLIB) $(INSTLIB)/$(DLLLIB)

install-pgm: $(PGM)
	$(INST) -d $(INSTBIN) -e $(PGM)

install-man:
	for i in $(MAN); do \
		$(INSTMAN) $$i $(AOLSERVER)/man; \
	done

install-html:
	for i in $(MAN); do \
		$(INSTMAN) -h $$i $(AOLSERVER)/html; \
	done

clean-mod:
	$(RM) $(MODBIN) $(MODOBJS)

clean-dll:
	$(RM) $(DLLBIN) $(DLLLIB) $(OBJS) $(LIBOBJ)

clean-pgm:
	$(RM) $(PGM) $(PGMOBJS)

.PHONY: clean-mod clean-dll clean-pgm install-man1 install-man3 install-mann