X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/halibut/blobdiff_plain/206ec2a1f0384794b8ee3f3882acf40543c32cb0..26c8c119efd44804c7b27f8637c69eda63f0c189:/Makefile diff --git a/Makefile b/Makefile index 280497f..6af0dc2 100644 --- a/Makefile +++ b/Makefile @@ -9,12 +9,15 @@ # Currently depends on GNU make, because: # - the Makefile uses GNU ifdef / ifndef commands and GNU make `%' # pattern rules +# - we use .PHONY prefix=/usr/local exec_prefix=$(prefix) bindir=$(exec_prefix)/bin INSTALL=install -c +.PHONY: all install clean spotless topclean release + ifdef RELEASE ifndef VERSION VERSION := $(RELEASE) @@ -42,15 +45,15 @@ endif all install: @test -d $(BUILDDIR) || mkdir $(BUILDDIR) - @make -C $(BUILDDIR) -f ../Makefile $@ REALBUILD=yes + @$(MAKE) -C $(BUILDDIR) -f ../Makefile $@ REALBUILD=yes spotless: topclean @test -d $(BUILDDIR) || mkdir $(BUILDDIR) - @make -C $(BUILDDIR) -f ../Makefile spotless REALBUILD=yes + @$(MAKE) -C $(BUILDDIR) -f ../Makefile spotless REALBUILD=yes clean: topclean @test -d $(BUILDDIR) || mkdir $(BUILDDIR) - @make -C $(BUILDDIR) -f ../Makefile clean REALBUILD=yes + @$(MAKE) -C $(BUILDDIR) -f ../Makefile clean REALBUILD=yes # Remove Halibut output files in the source directory (may # have been created by running, for example, `build/halibut @@ -61,29 +64,14 @@ topclean: # Make a release archive. If $(VERSION) is specified, this will # also contain a `manifest' file which will be used to decide the # version number automatically. -release: - find . -name CVS -prune -o -name build -prune -o -name reltmp -prune \ - -o -type d -exec mkdir -p reltmp/$(RELDIR)/{} \; - find . -name CVS -prune -o -name build -prune -o -name reltmp -prune \ - -o -name '*.orig' -prune -o -name '*.rej' -prune \ - -o -name '*.txt' -prune -o -name '*.html' -prune \ - -o -name '*.1' -prune -o -name '.cvsignore' -prune \ - -o -name '*.gz' -prune -o -name '.[^.]*' -prune \ - -o -type f -exec ln -s $(PWD)/{} reltmp/$(RELDIR)/{} \; - if test "x$(VERSION)y" != "xy"; then \ - (cd reltmp/$(RELDIR); \ - find . -name '*.[ch]' -exec md5sum {} \; \ - ) > reltmp/$(RELDIR)/manifest; \ - echo "-DVERSION=\"$(VERSION)\"" > reltmp/$(RELDIR)/version; \ - fi - tar chzvoCf reltmp - $(RELDIR) > $(RELDIR).tar.gz - rm -rf reltmp +release: release.sh + ./release.sh $(RELDIR) $(VERSION) else # The `real' makefile part. -CFLAGS += -Wall -W +CFLAGS += -Wall -W -ansi -pedantic ifdef TEST CFLAGS += -DLOGALLOC @@ -98,14 +86,18 @@ endif ifdef VER VDEF = -DVERSION=\"$(VER)\" else -VDEF = `(cd $(SRC); md5sum -c manifest && cat version)` +VDEF = `(cd $(SRC); md5sum -c manifest >/dev/null 2>&1 && cat version)` endif all: halibut SRC := ../ +ifeq ($(shell test -d $(SRC)charset && echo yes),yes) LIBCHARSET_SRCDIR = $(SRC)charset/ +else +LIBCHARSET_SRCDIR = $(SRC)../charset/ +endif LIBCHARSET_OBJDIR = ./# LIBCHARSET_OBJPFX = cs-# LIBCHARSET_GENPFX = charset-# @@ -114,9 +106,9 @@ CFLAGS += -I$(LIBCHARSET_SRCDIR) -I$(LIBCHARSET_OBJDIR) include $(LIBCHARSET_SRCDIR)Makefile MODULES := main malloc ustring error help licence version misc tree234 -MODULES += input keywords contents index style biblio +MODULES += input in_afm in_pf in_sfnt keywords contents index biblio MODULES += bk_text bk_html bk_whlp bk_man bk_info bk_paper bk_ps bk_pdf -MODULES += winhelp psdata wcwidth +MODULES += winhelp deflate psdata wcwidth OBJECTS := $(addsuffix .o,$(MODULES)) $(LIBCHARSET_OBJS) DEPS := $(addsuffix .d,$(MODULES))