blob: 1c018e453e443f2210357c365ab521706ba347dc [file] [log] [blame]
#
# Copyright 1999-2004 The Apache Software Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# @author Pier Fumagalli <mailto:pier@betaversion.org>
# @version $Id$
include @TGT_DIR@/Makedefs
# ========================================================================= #
# Generic/global compilation targets #
# ========================================================================= #
all: build
distclean: extra-clean
rm -f $(MODULE)/Makefile
rm -f lib/Makefile
rm -f Makedefs
rm -f Makefile
rm -f DETAILS.txt
rm -fr $(DST_DIR)
build: $(OBJ_DIR) @EXTRA_BUILD@ lib-build $(MODULE)-build $(BLD_DIR)/DETAILS.txt
@echo ""
@cat $(BLD_DIR)/DETAILS.txt
@echo ""
@echo All done...
extra-clean: @EXTRA_CLEAN@ clean
clean: lib-clean $(MODULE)-clean
rm -rf $(OBJ_DIR)
# ========================================================================= #
# Build the MODULE module, and copy the resulting file in the build dir. #
# ========================================================================= #
$(MODULE)-build: $(BLD_DIR)
@$(MAKE) SUBF="$(MAKEFLAGS)" SUBD="$(TGT_DIR)/$(MODULE)" SUBT="build" subdir
@$(INSTALL) $(TGT_DIR)/$(MODULE)/$(MODFILE) $(BLD_DIR)
$(MODULE)-clean:
@$(MAKE) SUBF="$(MAKEFLAGS)" SUBD="$(TGT_DIR)/$(MODULE)" SUBT="clean" subdir
@rm -f $(BLD_DIR)/$(MODFILE)
# ========================================================================= #
# Build all WebApp library files #
# ========================================================================= #
lib-build:
@$(MAKE) SUBF="$(MAKEFLAGS)" SUBD="$(TGT_DIR)/lib" SUBT="build" subdir
lib-clean:
@$(MAKE) SUBF="$(MAKEFLAGS)" SUBD="$(TGT_DIR)/lib" SUBT="clean" subdir
# ========================================================================= #
# Run ANT to generate all stuff it generates (jar,docs,javadocs) #
# ========================================================================= #
ant-build:
$(ANT) -buildfile "$(SRC_DIR)/build.xml" init $(ANT_TARGETS)
ant-clean:
$(ANT) -buildfile "$(SRC_DIR)/build.xml" clean
# ========================================================================= #
# Run PERL to generate our C-API documentation with scandoc #
# ========================================================================= #
capi-build: $(API_DIR)
$(PERL) "$(SRC_DIR)/support/scandoc.pl" \
-i "$(SRC_DIR)/support/template.pl" \
-p "$(API_DIR)/" \
$(SRC_DIR)/include/*.h
capi-clean:
@echo "Cleaning up generated C-API documentation"
@rm -rf "$(API_DIR)/*"
# ========================================================================= #
# Call APR and generate the library when we are building for Apache 1.3 #
# ========================================================================= #
apr-build: $(LIB_DIR)
@$(MAKE) SUBF="$(MAKEFLAGS)" SUBD="$(APR_DIR)" SUBT="all" subdir
$(LIBTOOL) --mode=install \
cp $(APR_DIR)/$(APR_LIBNAME) $(LIB_DIR)/$(APR_LIBNAME)
$(LIBTOOL) --mode=finish $(LIB_DIR)
apr-clean:
@$(MAKE) SUBF="$(MAKEFLAGS)" SUBD="$(APR_DIR)" SUBT="clean" subdir
# ========================================================================= #
# Invoke MAKE into a subdir (nicely notified by some messages) #
# ========================================================================= #
subdir:
@echo ""
@echo "$(MAKE)[$(MAKELEVEL)]: Entering directory \"$(SUBD)\""
@$(MAKE) -C "$(SUBD)" $(SUBF) "$(SUBT)"
@echo "$(MAKE)[$(MAKELEVEL)]: Exiting directory \"$(SUBD)\""
# ========================================================================= #
# Targets to build the directory structure (non-PHONY) #
# ========================================================================= #
$(LIB_DIR): $(BLD_DIR)
@if test ! -d "$(LIB_DIR)" ; then mkdir $(LIB_DIR) ; fi
$(OBJ_DIR): $(BLD_DIR)
@if test ! -d "$(OBJ_DIR)" ; then mkdir $(OBJ_DIR) ; fi
$(DOC_DIR): $(BLD_DIR)
@if test ! -d "$(DOC_DIR)" ; then mkdir $(DOC_DIR) ; fi
$(API_DIR): $(DOC_DIR)
@if test ! -d "$(API_DIR)" ; then mkdir $(API_DIR) ; fi
$(BLD_DIR):
@if test ! -d "$(BLD_DIR)" ; then mkdir $(BLD_DIR) ; fi
$(DST_DIR):
@if test ! -d "$(DST_DIR)" ; then mkdir $(DST_DIR) ; fi
# ========================================================================= #
# Our compilation details file #
# ========================================================================= #
$(BLD_DIR)/DETAILS.txt: $(BLD_DIR)
@echo "Storing build details" ; { \
echo "Coonfiguration details:" ; \
echo "" ; \
echo "module version: $(WEBAPP_VERSION)" ; \
echo "httpd version: $(APACHE_VERSION)" ; \
echo "host machine/os: $(HOST)" ; \
echo "cration date: $(DATE)" ; \
} > $@