gecko-dev/mstone/Makefile

240 lines
8.0 KiB
Makefile
Raw Normal View History

2000-03-28 01:22:46 +00:00
# Makefile for mstone
# use gmake
2000-03-28 01:22:46 +00:00
# Builds each of the components and then packages everything
topsrcdir = .
ifndef INCLUDED_CONFIG_MK
include $(topsrcdir)/config/config.mk
endif
CP := cp -p
ECHO := /bin/echo
2000-03-28 01:22:46 +00:00
# dynamically find the optional directories names
LIBGD_DIR = $(wildcard gd?.*)
GNUPLOT_DIR = $(wildcard gnuplot-?.*)
PERL_DIR = $(wildcard perl5.*)
# HACK, should figure out dynamically from PERL_DIR
PERL_REV = 5.00503
# file that we package
GDFILES = gd.txt gd.html gd.h libgd.* demoin.gif gddemo giftogd webgif
GNUPLOTFILES = gnuplot gnuplot_x11 gnuplot.1 gnuplot.gih Copyright
2000-03-28 01:35:11 +00:00
VERSION = 4.2
TARBALL = mstone-$(VERSION)-$(NSARCH)$(OBJDIR_TAG).tar.gz
2000-03-29 02:07:05 +00:00
ZIPFILE = mstone-$(VERSION)-$(NSARCH)$(OBJDIR_TAG).zip
2000-03-29 23:22:57 +00:00
TARBALL_ALL = mstone-$(VERSION)-all$(OBJDIR_TAG).tar.gz
ZIPFILE_ALL = mstone-$(VERSION)-all$(OBJDIR_TAG).zip
2000-03-28 01:35:11 +00:00
NTFILES = mstone.bat process.bat setup.bat
2000-03-28 01:22:46 +00:00
all:: usage
usage::
@$(ECHO) "gmake [ release | rpackage | debug | dpackage ]"
@$(ECHO) " [ DIST=/m/dist/mailstone/1999xxxx dist ]"
2000-03-28 01:22:46 +00:00
@$(ECHO) " [ all_DBG | all_OPT ]"
@$(ECHO) "perl is" $(PERL_DIR) ". gd is" $(LIBGD_DIR) ". gnuplot is" $(GNUPLOT_DIR) "."
targets:: $(OBJDIR) mailclient
ifneq (,$(LIBGD_DIR))
targets:: libgd
endif
ifneq (,$(GNUPLOT_DIR))
targets:: gnuplot
endif
ifneq (,$(PERL_DIR))
targets:: perl
endif
2000-03-28 01:22:46 +00:00
$(OBJDIR):
-mkdir -p $(OBJDIR)
mailclient::
2000-03-28 01:22:46 +00:00
@$(ECHO) "\n===== [`date`] making OS_CONFIG=$(NSARCH) BUILD_VARIANT=$(BUILD_VARIANT)\n"
cd src; $(MAKE) BUILD_VARIANT=$(BUILD_VARIANT) OBJDIR=../$(OBJDIR) PKGDIR=../$(PKGDIR) all
2000-03-28 01:22:46 +00:00
# Use our top level makefiles to drive the component builds
2000-03-29 02:07:05 +00:00
libgd $(OBJDIR)/gd/libgd.a::
2000-03-28 01:22:46 +00:00
$(MAKE) -f gd.mk LIBGD_DIR=$(LIBGD_DIR) libgd
2000-03-29 02:07:05 +00:00
gnuplot $(OBJDIR)/gnuplot/gnuplot::
2000-03-28 01:22:46 +00:00
$(MAKE) -f gnuplot.mk LIBGD_DIR=$(LIBGD_DIR) GNUPLOT_DIR=$(GNUPLOT_DIR) gnuplot
2000-03-29 02:07:05 +00:00
perl $(OBJDIR)/perl/perl::
2000-03-28 01:22:46 +00:00
$(MAKE) -f perl.mk PERL_DIR=$(PERL_DIR) PERL_REV=$(PERL_REV) perl
# Create packaging binary directories
# Note: dont make gd or gnuplot here. For multi-OS, they are links
2000-03-28 01:22:46 +00:00
mkpkgdirs:: $(PKGDIR)/bin $(PKGDIR)/conf $(PKGDIR)/data $(PKGDIR)/doc
$(PKGDIR)/bin:
mkdir -p $(PKGDIR)/bin
$(PKGDIR)/conf:
mkdir -p $(PKGDIR)/conf
$(PKGDIR)/data:
mkdir -p $(PKGDIR)/data
$(PKGDIR)/doc:
mkdir -p $(PKGDIR)/doc
$(PKGDIR)/gd:
mkdir -p $(PKGDIR)/gd
$(PKGDIR)/gnuplot:
mkdir -p $(PKGDIR)/gnuplot
2000-03-29 02:07:05 +00:00
$(PKGDIR)/perl:
mkdir -p $(PKGDIR)/perl
# operating system independent share-files (at least for Unix)
pkg-share-files:: mkpkgdirs
@$(ECHO) "\n===== [`date`] making package share-files...\n"
2000-03-29 23:22:57 +00:00
$(CP) mstone process $(PKGDIR)
2000-03-29 02:07:05 +00:00
(cd $(PKGDIR); [ ! -f setup ] || rm -f setup; ln -s mstone setup)
(cd $(PKGDIR); [ ! -f cleanup ] || rm -f cleanup; ln -s mstone cleanup)
(cd $(PKGDIR); [ ! -f checktime ] || rm -f checktime; ln -s mstone checktime)
(cd $(PKGDIR); [ ! -f timesync ] || rm -f timesync; ln -s mstone timesync)
$(CP) nsarch bin/*.pl $(PKGDIR)/bin
2000-03-29 23:22:57 +00:00
$(CP) conf/*.wld conf/*.wld.in conf/*.html $(PKGDIR)/conf
$(CP) data/*.msg $(PKGDIR)/data
2000-03-28 01:22:46 +00:00
$(CP) doc/*.html doc/*.gif $(PKGDIR)/doc
$(CP) INSTALL $(PKGDIR)
$(CP) README $(PKGDIR)
$(CP) ChangeLog $(PKGDIR)
$(CP) LICENSE $(PKGDIR)
@$(ECHO) "\n===== [`date`] making package share-files done.\n"
# split out OS specific file so that combined packaging possible (set PKGDIR)
2000-03-28 01:22:46 +00:00
pkg-arch-files-gd:: $(PKGDIR)/gd $(OBJDIR)/gd/libgd.a
$(CP) $(addprefix $(OBJDIR)/gd/, $(GDFILES)) $(PKGDIR)/gd
-$(STRIP) $(PKGDIR)/gd/webgif $(PKGDIR)/gd/giftogd $(PKGDIR)/gd/gddemo
pkg-arch-files-gnuplot:: $(PKGDIR)/gnuplot $(OBJDIR)/gnuplot/gnuplot
$(CP) $(addprefix $(OBJDIR)/gnuplot/, $(GNUPLOTFILES)) $(PKGDIR)/gnuplot
-$(STRIP) $(PKGDIR)/gnuplot/gnuplot $(PKGDIR)/gnuplot/gnuplot_x11
ifneq (,$(LIBGD_DIR))
pkg-arch-files:: pkg-arch-files-gd
endif
2000-03-28 01:22:46 +00:00
ifneq (,$(GNUPLOT_DIR))
pkg-arch-files:: pkg-arch-files-gnuplot
endif
pkg-arch-files:: $(PKGDIR)/bin $(OBJDIR)/mailclient
$(CP) $(OBJDIR)/mailclient $(PKGDIR)/bin
-$(STRIP) $(PKGDIR)/bin/mailclient
@$(ECHO) "\n===== [`date`] making package arch-files done.\n"
2000-03-29 02:07:05 +00:00
pkg-perl-files:: $(PKGDIR)/bin $(OBJDIR)/perl/perl
@$(ECHO) "\n===== [`date`] making package perl-files...\n"
2000-03-29 02:07:05 +00:00
$(MAKE) -f perl.mk PERL_DIR=$(PERL_DIR) PERL_REV=$(PERL_REV) \
BUILD_VARIANT=$(BUILD_VARIANT) \
OBJDIR=$(OBJDIR) PKGDIR=$(PKGDIR) package-perl
find $(PKGDIR)/perl/lib -name .packlist -exec rm {} \; -print
-$(STRIP) $(PKGDIR)/perl/bin/perl
-$(STRIP) $(PKGDIR)/perl/bin/a2p
@$(ECHO) "\n===== [`date`] making package perl-files done.\n"
2000-03-29 02:07:05 +00:00
# for combined packaging, this should not be part of pkg-arch-files
# perl is handled seperately do to its size
2000-03-28 01:22:46 +00:00
ifneq (,$(PERL_DIR))
pkg:: pkg-perl-files
endif
pkg:: targets build/$(TARBALL)
build/$(TARBALL): pkg-share-files pkg-arch-files
@$(ECHO) "\n===== [`date`] making os package file...\n"
2000-03-28 01:22:46 +00:00
-rm -f build/$(TARBALL)
cd $(dir $(PKGDIR)) && \
tar cf - . | gzip > ../../$(TARBALL)
@$(ECHO) "\n===== [`date`] making os package file done.\n"
2000-03-28 01:22:46 +00:00
########################################################################
# Generate a combined build for every Unix OS that is already packaged
# NT has to be done seperately because it has different file names
# We have to nuke some old parts, because permissions wont allow overwrites
# Finally, dont ship perl development headers and libraries
all_DBG all_OPT::
2000-03-29 02:07:05 +00:00
@$(ECHO) "===== [`date`] unified packaging for $@..."
2000-03-28 01:22:46 +00:00
$(MAKE) NSARCH=$@ OBJDIR_TAG='' PKGDIR=$(topsrcdir)/build/package/$@.OBJ/mstone pkg-share-files
./ospkg.sh $@.OBJ $(notdir $(shell ls -d build/package/[A-Z]*$(subst all,,$@.OBJ)))
2000-03-28 01:35:11 +00:00
[ -d $(topsrcdir)/build/package/$@.OBJ/mstone/bin/WINNT4.0 ] \
&& cp -p $(NTFILES) $(topsrcdir)/build/package/$@.OBJ/mstone; :
-rm -f ./build/mstone-$(VERSION)-$@.tar.gz
2000-03-29 02:07:05 +00:00
cd ./build/package/$@.OBJ && tar cf - . \
| gzip > ../../mstone-$(VERSION)-$@.tar.gz
-rm -f ./build/mstone-$(VERSION)-$@.zip
cd ./build/package/$@.OBJ && zip -r -q ../../mstone-$(VERSION)-$@.zip .
@$(ECHO) "===== [`date`] unified packaging for $@ done."
2000-03-28 01:22:46 +00:00
########################################################################
2000-03-29 02:07:05 +00:00
# Copy all the packaged trees to the distribution site
# Copy in the unified tarball and zip file
# Link mstone to mailstone for Netscape back compatibility
# Re-map short Linux name to standard Netscape convention
dist::
@[ "$(DIST)" != "" ] || ($(MAKE) usage && /bin/false)
@[ ! -d "$(DIST)" ] || ($(ECHO) "Error: $(DIST) already exists" && \
$(MAKE) usage && /bin/false)
mkdir -p $(DIST)
2000-03-29 23:22:57 +00:00
cp -p build/mstone-$(VERSION)-all_*.tar.gz build/mstone-$(VERSION)-all_*.zip $(DIST)/
2000-03-29 02:07:05 +00:00
(cd build/package; tar cf - *.OBJ) | (cd $(DIST); tar xf - )
for l in $(DIST)/*_???.OBJ ; do \
(cd $$l; ln -s mstone mailstone); done
cd $(DIST); for l in Linux*_???.OBJ ; do \
nn=`echo $$l | sed -e 's/_OPT/_glibc_PTH_OPT/' | sed -e 's/_DBG/_glibc_PTH_DBG/'`; \
ln -s $$l $$nn; done
2000-03-29 02:07:05 +00:00
# since the default is debug mode, start a make with the right mode
release::
@$(ECHO) "\n===== [`date`] making release build...\n"
$(MAKE) BUILD_VARIANT=release OBJDIR_TAG=_OPT targets
@$(ECHO) "\n===== [`date`] making release build done.\n"
rpackage:: release
@$(ECHO) "\n===== [`date`] making release package...\n"
$(MAKE) BUILD_VARIANT=release OBJDIR_TAG=_OPT pkg
@$(ECHO) "\n===== [`date`] making release package done.\n"
2000-03-29 02:07:05 +00:00
# since the default is debug mode, this can just work off a dependency
2000-03-28 01:22:46 +00:00
debug:: targets
# @$(ECHO) "\n===== [`date`] making debug build...\n"
# $(MAKE) BUILD_VARIANT=debug OBJDIR_TAG=_DBG targets
# @$(ECHO) "\n===== [`date`] making debug build done.\n"
2000-03-29 02:07:05 +00:00
# since the default is debug mode, this can just work off a dependency
2000-03-28 01:22:46 +00:00
dpackage:: pkg
#dpackage:: debug
# @$(ECHO) "\n===== [`date`] making debug package...\n"
# $(MAKE) BUILD_VARIANT=debug OBJDIR_TAG=_DBG pkg
# @$(ECHO) "\n===== [`date`] making debug package done.\n"
cleanvariant::
2000-03-28 01:22:46 +00:00
(cd src; $(MAKE) OBJDIR=../$(OBJDIR) clean)
rm -rf $(PKGDIR)
clean::
$(MAKE) BUILD_VARIANT=release OBJDIR_TAG=_OPT cleanvariant
$(MAKE) BUILD_VARIANT=debug OBJDIR_TAG=_DBG cleanvariant
distcleanvariant::
2000-03-28 01:22:46 +00:00
(cd src; $(MAKE) OBJDIR=../$(OBJDIR) distclean)
rm -rf $(OBJDIR) $(PKGDIR)
distclean:: clean
$(MAKE) BUILD_VARIANT=release OBJDIR_TAG=_OPT distcleanvariant
$(MAKE) BUILD_VARIANT=debug OBJDIR_TAG=_DBG distcleanvariant