1# Makefile.in -- 2# 3# This file is a Makefile for the tclhttpd web server 4# 5# Copyright (c) 1999-2000 Scriptics Corporation. 6# 7# See the file "license.terms" for information on usage and redistribution 8# of this file, and for a DISCLAIMER OF ALL WARRANTIES. 9# 10# RCS: @(#) $Id: Makefile.in,v 1.30 2003/08/11 16:46:57 welch Exp $ 11 12#======================================================================== 13# Edit the following few lines when writing a new extension 14#======================================================================== 15 16#======================================================================== 17# Change the name of the variable "exampleA_LIB_FILE" to match the one 18# used in the configure script. This is the parameterized name of the 19# library that we are building. 20#======================================================================== 21 22#lib_BINARIES=$(crypt_LIB_FILE) $(limit_LIB_FILE) 23lib_BINARIES=$(crypt_LIB_FILE) @LIMIT_EXTENSION@ 24BINARIES=$(lib_BINARIES) 25 26#======================================================================== 27# Enumerate the names of the source files included in this package. 28# This will be used when a dist target is added to the Makefile. 29#======================================================================== 30 31limit_SOURCES = src/limit.c 32crypt_SOURCES = src/crypt.c src/cryptLib.c 33SOURCES = $(crypt_SOURCES) $(limit_SOURCES) 34 35#======================================================================== 36# Enumerate the names of the object files included in this package. 37# These objects are created and linked into the final library. In 38# most cases these object files will correspond to the source files 39# above. 40# 41# CRYPT_OBJS is the name of the object files needed to provide the 42# crypt() C function. Most unix platforms already have it in a standard 43# library. Windows doesn't, so we need to account for that possibility 44# here. 45#======================================================================== 46 47CRYPT_OBJS = @CRYPT_OBJS@ 48limit_OBJECTS = limit.$(OBJEXT) 49crypt_OBJECTS = crypt.$(OBJEXT) $(CRYPT_OBJS) 50OBJECTS = $(crypt_OBJECTS) 51 52#======================================================================== 53# The substitution of "exampleA_LIB_FILE" into the variable name below 54# allows us to refer to the objects for the library without knowing the name 55# of the library in advance. It also lets us use the "$@" variable in 56# the rule for building the library, so we can refer to both the list of 57# objects and the library itself in a platform-independent manner. 58#======================================================================== 59 60limit_LIB_FILE = @limit_LIB_FILE@ 61$(limit_LIB_FILE)_OBJECTS = $(limit_OBJECTS) 62 63crypt_LIB_FILE = @crypt_LIB_FILE@ 64$(crypt_LIB_FILE)_OBJECTS = $(crypt_OBJECTS) 65 66#======================================================================== 67# This is a list of header files to be installed 68#======================================================================== 69 70GENERIC_HDRS= 71 72#======================================================================== 73# Add additional lines to handle any additional AC_SUBST cases that 74# have been added to the configure script. 75#======================================================================== 76 77# SAMPLE_NEW_VAR=@SAMPLE_NEW_VAR@ 78 79BUILD_LIMIT = @BUILD_LIMIT@ 80 81# DISTDIR and DEST are used when creating distributions 82 83DISTDIR=/tmp/ 84DEST=${DISTDIR}/tclhttpd-${VERSION} 85TCL_VERSION=@TCL_VERSION@ 86TCLLIB_VERSION=@TCLLIB_VERSION@ 87TCL_DIR=@TCL_DIR@ 88TCLLIB_DIR=@TCLLIB_DIR@ 89THREAD_VERSION=@THREAD_VERSION@ 90 91#======================================================================== 92# Nothing of the variables below this line need to be changed. Please 93# check the TARGETS section below to make sure the make targets are 94# correct. 95#======================================================================== 96 97SHELL = @SHELL@ 98 99srcdir = @srcdir@ 100top_srcdir = @top_srcdir@ 101prefix = @prefix@ 102exec_prefix = @exec_prefix@ 103 104bindir = @bindir@ 105sbindir = @sbindir@ 106libexecdir = @libexecdir@ 107datadir = @datadir@ 108sysconfdir = @sysconfdir@ 109sharedstatedir = @sharedstatedir@ 110localstatedir = @localstatedir@ 111libdir = @libdir@ 112infodir = @infodir@ 113mandir = @mandir@ 114includedir = @includedir@ 115oldincludedir = /usr/include 116 117DESTDIR = 118 119pkgdatadir = $(datadir)/@PACKAGE@@VERSION@ 120pkglibdir = $(libdir)/@PACKAGE@@VERSION@ 121cryptlibdir = $(libdir)/@CRYPT_PACKAGE@@CRYPT_VERSION@ 122limitlibdir = $(libdir)/@LIMIT_PACKAGE@@LIMIT_VERSION@ 123pkgincludedir = $(includedir)/@PACKAGE@@VERSION@ 124SERVER_ROOT = @SERVER_ROOT@ 125htdocsdir = $(prefix)/share/@PACKAGE@@VERSION@ 126customdir = $(SERVER_ROOT)/custom 127 128top_builddir = . 129 130INSTALL = @INSTALL@ 131INSTALL_PROGRAM = @INSTALL_PROGRAM@ -m 755 132INSTALL_DATA = @INSTALL_DATA@ -m 644 133INSTALL_SCRIPT = @INSTALL_SCRIPT@ -m 644 134INSTALL_STRIP_FLAG = 135transform = @program_transform_name@ 136 137NORMAL_INSTALL = : 138PRE_INSTALL = : 139POST_INSTALL = : 140NORMAL_UNINSTALL = : 141PRE_UNINSTALL = : 142POST_UNINSTALL = : 143 144PACKAGE = @PACKAGE@ 145VERSION = @VERSION@ 146RELEASE = @RELEASE@ 147WIN_VERSION = @WIN_VERSION@ 148CC = @CC@ 149CFLAGS_DEBUG = @CFLAGS_DEBUG@ 150CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ 151CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@ 152CLEANFILES = @CLEANFILES@ 153EXEEXT = @EXEEXT@ 154LDFLAGS_DEBUG = @LDFLAGS_DEBUG@ 155LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@ 156LDFLAGS_OPTIMIZE = @LDFLAGS_OPTIMIZE@ 157MAKE_LIB = @MAKE_LIB@ 158MAKE_SHARED_LIB = @MAKE_SHARED_LIB@ 159MAKE_STATIC_LIB = @MAKE_STATIC_LIB@ 160OBJEXT = @OBJEXT@ 161RANLIB = @RANLIB@ 162SHLIB_CFLAGS = @SHLIB_CFLAGS@ 163SHLIB_LD = @SHLIB_LD@ 164SHLIB_LDFLAGS = @SHLIB_LDFLAGS@ 165SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ 166STLIB_LD = @STLIB_LD@ 167TCL_BIN_DIR = @TCL_BIN_DIR@ 168TCL_DEFS = @TCL_DEFS@ 169TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ 170TCL_LD_FLAGS = @TCL_LD_FLAGS@ 171TCL_LIBS = @TCL_LIBS@ 172TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ 173TCL_SRC_DIR = @TCL_SRC_DIR@ 174TCL_DBGX = @TCL_DBGX@ 175TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ 176TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ 177TCL_TOOL_DIR_NATIVE = @TCL_TOOL_DIR_NATIVE@ 178TCL_TOP_DIR_NATIVE = @TCL_TOP_DIR_NATIVE@ 179TCL_UNIX_DIR_NATIVE = @TCL_UNIX_DIR_NATIVE@ 180TCL_WIN_DIR_NATIVE = @TCL_WIN_DIR_NATIVE@ 181INCLUDE_DIR_NATIVE = @INCLUDE_DIR_NATIVE@ 182TCL_BMAP_DIR_NATIVE = @TCL_BMAP_DIR_NATIVE@ 183TCL_PLATFORM_DIR_NATIVE = @TCL_PLATFORM_DIR_NATIVE@ 184TCL_GENERIC_DIR_NATIVE = @TCL_GENERIC_DIR_NATIVE@ 185TCLSH_PROG = @TCLSH_PROG@ 186SHARED_BUILD = @SHARED_BUILD@ 187 188AUTOCONF = autoconf 189 190LDFLAGS = $(LDFLAGS_DEFAULT) 191 192INCLUDES = @TCL_INCLUDES@ 193 194EXTRA_CFLAGS = $(PROTO_FLAGS) $(SECURITY_FLAGS) $(MEM_DEBUG_FLAGS) $(KEYSYM_FLAGS) $(NO_DEPRECATED_FLAGS) 195 196DEFS = @DEFS@ $(TCL_DEFS) $(TCL_EXTRA_CFLAGS) $(EXTRA_CFLAGS) 197 198ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 199CONFIGDIR = @CONFIGDIR@ 200mkinstalldirs = mkdir -p 201CONFIG_CLEAN_FILES = 202 203CPPFLAGS = @CPPFLAGS@ 204LIBS = @LIBS@ 205AR = ar 206CFLAGS = @CFLAGS@ 207COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) 208CCLD = $(CC) 209LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ 210 211#======================================================================== 212# Start of user-definable TARGETS section 213#======================================================================== 214 215#======================================================================== 216# TEA TARGETS. Please note that the "libraries:" target refers to platform 217# independent files, and the "binaries:" target inclues executable programs and 218# platform-dependent libraries. Modify these targets so that they install 219# the various pieces of your package. The make and install rules 220# for the BINARIES that you specified above have already been done. 221#======================================================================== 222 223all: libraries doc 224 225#======================================================================== 226# The binaries target builds executable programs, Windows .dll's, unix 227# shared/static libraries, and any other platform-dependent files. 228# The list of targets to build for "binaries:" is specified at the top 229# of the Makefile, in the "BINARIES" variable. 230#======================================================================== 231 232binaries: $(BINARIES) 233 234 235libraries: 236 237doc: 238 239install: all install-libraries install-doc 240 241install-binaries: binaries install-lib-binaries 242 243test: 244 245depend: 246 247#======================================================================== 248# Enumerate the names of the object files included in this package. 249# These objects are created and linked into the final library. In 250# most cases these object files will correspond to the source files 251# above. 252# 253# $(exampleA_LIB_FILE) should be listed as part of the BINARIES variable 254# at the top of the Makefile. That will ensure that this target is built 255# when you run "make binaries". 256# 257# You shouldn't need to modify this target, except to change the package 258# name from "exampleA" to your package's name. 259#======================================================================== 260 261# NOTE - MAKE_LIB can't work here, because it wants to reference 262# tclhttpd_LIB_OBJECTS, but we need to make two extensions. 263# So, we directly jam in the MAKE_SHARED_LIB macro results, but 264# only the Unix variant. These extensions don't apply to Windows anyway 265 266$(crypt_LIB_FILE): $(crypt_OBJECTS) 267 -rm -f $(crypt_LIB_FILE) 268 ${SHLIB_LD} -o $@ $(crypt_OBJECTS) ${SHLIB_LDFLAGS} ${SHLIB_LD_LIBS} 269 270 $(RANLIB) $(crypt_LIB_FILE) 271 272$(limit_LIB_FILE): $(limit_OBJECTS) 273 -rm -f $(limit_LIB_FILE) 274 ${SHLIB_LD} -o $@ $(limit_OBJECTS) ${SHLIB_LDFLAGS} ${SHLIB_LD_LIBS} 275 $(RANLIB) $(limit_LIB_FILE) 276 277#======================================================================== 278# We need to enumerate the list of .c to .o lines here. 279# Unfortunately, there does not seem to be any other way to do this 280# in a Makefile-independent way. We can't use VPATH because it picks up 281# object files that may be located in the source directory. 282# 283# In the following lines, $(srcdir) refers to the toplevel directory 284# containing your extension. If your sources are in a subdirectory, 285# you will have to modify the paths to reflect this: 286# 287# exampleA.$(OBJEXT): $(srcdir)/src/win/exampleA.c 288# $(COMPILE) -c `@CYGPATH@ $(srcdir)/src/win/exampleA.c` -o $@ 289#======================================================================== 290 291limit.$(OBJEXT): $(srcdir)/src/limit.c 292 $(COMPILE) -c `@CYGPATH@ $(srcdir)/src/limit.c` -o $@ 293 294crypt.$(OBJEXT): $(srcdir)/src/crypt.c 295 $(COMPILE) -c `@CYGPATH@ $(srcdir)/src/crypt.c` -o $@ 296 297cryptLib.$(OBJEXT): $(srcdir)/src/cryptLib.c 298 $(COMPILE) -c `@CYGPATH@ $(srcdir)/src/cryptLib.c` -o $@ 299 300 301install-binaries: 302 @echo "Installing script programs in $(DESTDIR)$(prefix)/bin" 303 @for i in $(srcdir)/bin/*.tcl ; do \ 304 $(INSTALL_PROGRAM) $$i $(DESTDIR)$(prefix)/bin ; \ 305 done; 306 @for i in $(srcdir)/bin/*.rc ; do \ 307 $(INSTALL_DATA) $$i $(DESTDIR)$(prefix)/bin ; \ 308 done; 309 @echo "Installing sample boot script" 310 $(INSTALL_DATA) $(srcdir)/bin/tclhttpd.etc.init $(DESTDIR)$(SERVER_ROOT) 311 312install-libraries: install-custom installdirs 313 @echo "Installing script files in $(DESTDIR)$(pkglibdir)" 314 @for i in $(srcdir)/lib/*.tcl ; do \ 315 $(INSTALL_SCRIPT) $$i $(DESTDIR)$(pkglibdir) ; \ 316 done; 317 $(INSTALL_SCRIPT) $(srcdir)/lib/mime.types $(DESTDIR)$(pkglibdir) 318 319install-htdocs: 320 @echo "Creating htdocs tree in $(htdocsdir)" 321 -chmod 755 `@CYGPATH@ $(srcdir)/htdocs/cgi-bin/*.cgi` 322 $(TCLSH_PROG) `@CYGPATH@ $(srcdir)/bin/CopyDist` `@CYGPATH@ $(srcdir)/htdocs` `@CYGPATH@ $(DESTDIR)$(htdocsdir)` 323 -$(mkinstalldirs) $(DESTDIR)$(htdocsdir)/links 324 @echo "Copying some READMEs into $(htdocsdir)/links" 325 $(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(htdocsdir)/links/README.txt 326 $(INSTALL_DATA) $(srcdir)/certs/README.ssl $(DESTDIR)$(htdocsdir)/links/README.ssl.txt 327 $(INSTALL_DATA) $(srcdir)/WHATSNEW $(DESTDIR)$(htdocsdir)/links/WHATSNEW.txt 328 $(INSTALL_DATA) $(srcdir)/INSTALL $(DESTDIR)$(htdocsdir)/links/INSTALL.txt 329 @echo "Copying license.terms into $(DESTDIR)$(htdocsdir)" 330 $(INSTALL_DATA) $(srcdir)/license.terms $(DESTDIR)$(htdocsdir)/license.terms 331 $(INSTALL_DATA) $(srcdir)/doc/httpd.1 $(DESTDIR)$(mandir)/man1/tclhttpd.1 332install-custom: 333 @echo "Adding custom code in $(DESTDIR)$(customdir)" 334 $(TCLSH_PROG) `@CYGPATH@ $(srcdir)/bin/CopyDist` `@CYGPATH@ $(srcdir)/custom` `@CYGPATH@ $(DESTDIR)$(customdir)` 335 336install-doc: install-htdocs 337 @echo "Installing README" 338 $(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(SERVER_ROOT) 339 $(INSTALL_DATA) $(srcdir)/bin/README_custom $(DESTDIR)$(SERVER_ROOT) 340 341installdirs: 342 $(mkinstalldirs) $(DESTDIR)$(pkglibdir) $(DESTDIR)$(prefix)/bin $(DESTDIR)$(htdocsdir) $(DESTDIR)$(customdir) 343 344clean: 345 -test -z "$(BINARIES)" || rm -f $(BINARIES) 346 -rm -f *.o core *.core 347 -rm -f *.$(OBJEXT) 348 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 349 350distclean: clean 351 -rm -f *.tab.c 352 -rm -f Makefile $(CONFIG_CLEAN_FILES) 353 -rm -f config.cache config.log stamp-h stamp-h[0-9]* 354 -rm -f config.status 355 -rm -f limit_pkgIndex.tcl crypt_pkgIndex.tcl 356 357#======================================================================== 358# Install binary object libraries. On Windows this includes both .dll and 359# .lib files. Because the .lib files are not explicitly listed anywhere, 360# we need to deduce their existence from the .dll file of the same name. 361# Additionally, the .dll files go into the bin directory, but the .lib 362# files go into the lib directory. On Unix platforms, all library files 363# go into the lib directory. In addition, this will generate the pkgIndex.tcl 364# file in the install location (assuming it can find a usable tclsh8.2 shell) 365# 366# You should not have to modify this target. 367#======================================================================== 368 369install-lib-binaries: installdirs 370 @list='$(lib_BINARIES)'; for p in $$list; do \ 371 if test -f $$p; then \ 372 ext=`echo $$p|sed -e "s/.*\.//"`; \ 373 if test "x$$ext" = "xdll"; then \ 374 echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p"; \ 375 $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p; \ 376 lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \ 377 if test -f $$lib; then \ 378 echo " $(INSTALL_PROGRAM) $$lib $(DESTDIR)$(libdir)/$$lib"; \ 379 $(INSTALL_PROGRAM) $$lib $(DESTDIR)$(libdir)/$$lib; \ 380 fi; \ 381 else \ 382 echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libdir)/$$p"; \ 383 $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libdir)/$$p; \ 384 fi; \ 385 else :; fi; \ 386 done 387 @list='$(lib_BINARIES)'; for p in $$list; do \ 388 if test -f $$p; then \ 389 echo " $(RANLIB) $(DESTDIR)$(libdir)/$$p"; \ 390 $(RANLIB) $(DESTDIR)$(libdir)/$$p; \ 391 else :; fi; \ 392 done 393 $(INSTALL_SCRIPT) crypt_pkgIndex.tcl $(DESTDIR)$(cryptlibdir)/pkgIndex.tcl 394 if test "$(BUILD_LIMIT)" = "1" ; then \ 395 $(mkinstalldirs) $(DESTDIR)$(limitlibdir) ; \ 396 $(INSTALL_SCRIPT) limit_pkgIndex.tcl $(DESTDIR)$(limitlibdir)/pkgIndex.tcl;\ 397 fi 398 399Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 400 cd $(top_builddir) \ 401 && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status 402 403# dist target 404 405dist: 406 rm -rf $(DEST) 407 mkdir $(DEST) 408 $(TCLSH_PROG) $(srcdir)/bin/CopyDist $(srcdir) $(DEST) 409 (cd $(DISTDIR); tar cf - ./tclhttpd-$(VERSION) | gzip > tclhttpd-$(VERSION).tar.gz) 410 (cd $(DISTDIR) ; zip -9 -r -o tclhttpd$(WIN_VERSION).zip tclhttpd-$(VERSION)) 411 412rpm: dist 413 rm -rf $(DISTDIR)/dist 414 mkdir -p $(DISTDIR)/dist/SPECS 415 mkdir -p $(DISTDIR)/dist/SRPMS 416 mkdir -p $(DISTDIR)/dist/RPMS 417 mkdir -p $(DISTDIR)/dist/SOURCES 418 mkdir -p $(DISTDIR)/dist/BUILD 419 cp $(DISTDIR)/$(PACKAGE)-$(VERSION).tar.gz $(DISTDIR)/dist/SOURCES/ 420 cp $(srcdir)/$(PACKAGE).spec $(DISTDIR)/dist/SPECS/$(PACKAGE)-$(VERSION)-$(RELEASE).spec 421 rpmbuild --define "_topdir $(DISTDIR)/dist" -ba $(DISTDIR)/dist/SPECS/$(PACKAGE)-$(VERSION)-$(RELEASE).spec 422 423.PHONY: all binaries clean depend distclean doc install installdirs \ 424libraries test 425 426# Tell versions [3.59,3.63) of GNU make to not export all variables. 427# Otherwise a system limit (for SysV at least) may be exceeded. 428.NOEXPORT: 429