зеркало из https://github.com/mozilla/pjs.git
126 строки
3.6 KiB
Makefile
126 строки
3.6 KiB
Makefile
|
# The contents of this file are subject to the Mozilla 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://www.mozilla.org/NPL/
|
||
|
#
|
||
|
# 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 the Tinderbox build tool.
|
||
|
#
|
||
|
# The Initial Developer of the Original Code is Netscape Communications
|
||
|
# Corporation. Portions created by Netscape are
|
||
|
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||
|
# Rights Reserved.
|
||
|
#
|
||
|
|
||
|
# Complete rewrite by Ken Estes:
|
||
|
# kestes@staff.mail.com Old work.
|
||
|
# kestes@reefedge.com New work.
|
||
|
# kestes@walrus.com Home.
|
||
|
# Contributor(s): Stephen Lamm (slamm@yahoo-inc.com)
|
||
|
|
||
|
# Files are processed by the perl script ./config.out as they are copied
|
||
|
# from the source tree to the build tree.
|
||
|
|
||
|
# Files are installed without change from the build directory into the
|
||
|
# tree rooted at prefix.
|
||
|
|
||
|
|
||
|
# Makefile Variables
|
||
|
#------------------------------------------------------------
|
||
|
|
||
|
# the prefix where most of the binaries will be install
|
||
|
prefix=@prefix@
|
||
|
|
||
|
# the directory where the cgibin files must go
|
||
|
cgibin_prefix=@cgibin_prefix@
|
||
|
|
||
|
# the root of the html directory
|
||
|
html_prefix=@html_prefix@
|
||
|
|
||
|
# where files will be built before they are installed
|
||
|
builddir=@builddir@
|
||
|
|
||
|
config_script=@config_script@
|
||
|
confdir=localconf
|
||
|
|
||
|
# Makefile Targets
|
||
|
#------------------------------------------------------------
|
||
|
|
||
|
all: build
|
||
|
ALL: all
|
||
|
|
||
|
build: make_build_dirs build_files set_build_permissions
|
||
|
|
||
|
install: build make_install_dirs install_files
|
||
|
|
||
|
clean:
|
||
|
@echo
|
||
|
@echo "----- Cleaning Build Directory-----"
|
||
|
@echo
|
||
|
rm -rf $(builddir)
|
||
|
|
||
|
|
||
|
# We do not accidently wish to edit to the 'binary' version of these
|
||
|
# files so ensure the build dir copies are not writable.
|
||
|
|
||
|
set_build_permissions:
|
||
|
@echo
|
||
|
@echo "----- Setting Build directory permissions -----"
|
||
|
find $(builddir) -type f | xargs chmod 444
|
||
|
find $(builddir)/bin -type f | xargs chmod 555
|
||
|
find $(builddir)/test -type f -name 'gen*' | xargs chmod 555
|
||
|
find $(builddir)/clientbin -type f | xargs chmod 555
|
||
|
|
||
|
compile_all_code: build
|
||
|
@echo
|
||
|
@echo "----- Testing if perl can compile code -----"
|
||
|
find $(builddir) -type f | \
|
||
|
egrep -v -i "readme|\.gif|/test/|addimage.cgi|images.pm|bustagestats.cgi|Storable.pm" | \
|
||
|
xargs -l perl -T -c
|
||
|
|
||
|
compile_bin_code: build
|
||
|
@echo
|
||
|
@echo "----- Testing if perl can compile all files in the bin directory -----"
|
||
|
find $(builddir)/bin -type f | \
|
||
|
egrep -v -i "readme|\.gif|/test/|addimage.cgi|images.pm|bustagestats.cgi|Storable.pm" | \
|
||
|
xargs -l perl -T -c
|
||
|
|
||
|
gen_test: compile_bin_code
|
||
|
rm -rf $(html_prefix)
|
||
|
perl $(builddir)/test/genbuilds.tst
|
||
|
perl $(builddir)/test/gennotices.tst
|
||
|
perl $(builddir)/test/genbugs.tst
|
||
|
$(builddir)/bin/tinder.cgi --daemon-mode
|
||
|
|
||
|
link_test:
|
||
|
find $(builddir) -type f -print | \
|
||
|
egrep -v -i "test|mage" | \
|
||
|
xargs egrep -i "<a +href"
|
||
|
|
||
|
STAGE_FILE := \
|
||
|
tb2StageFile() { \
|
||
|
source=$$1; \
|
||
|
target=$$2; \
|
||
|
if [ -f $$target ]; then chmod +w $$target; fi; \
|
||
|
perl $(config_script) < $$source > $$target; \
|
||
|
chmod -w $$target; \
|
||
|
echo "Staging $$source" 2>&1; \
|
||
|
}; tb2StageFile
|
||
|
|
||
|
INSTALL_FILE := \
|
||
|
tb2InstallFile() { \
|
||
|
source=$$1; \
|
||
|
target=$$2; \
|
||
|
if [ -f $$target ]; then chmod +w $$target; fi; \
|
||
|
echo "Install $$source -> $$target" 2>&1; \
|
||
|
cp -p $$source $$target; \
|
||
|
}; tb2InstallFile
|
||
|
|
||
|
# Automated file list is generated after this line
|
||
|
#------------------------------------------------------------
|
||
|
|