summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2017-05-20 08:42:45 +0100
committerSimon Tatham <anakin@pobox.com>2017-05-20 08:48:11 +0100
commit41394e187f6fad8dfb44baefe7603b77c0bff57b (patch)
tree6fb71966e4473fa2169047112dcd2abc52724240 /Makefile
parent80d18da9a127d1d7d111625133742691b9aeedfe (diff)
downloadhalibut-41394e187f6fad8dfb44baefe7603b77c0bff57b.zip
halibut-41394e187f6fad8dfb44baefe7603b77c0bff57b.tar.gz
halibut-41394e187f6fad8dfb44baefe7603b77c0bff57b.tar.bz2
halibut-41394e187f6fad8dfb44baefe7603b77c0bff57b.tar.xz
Replace Halibut's makefiles with autotools.
This commit updates the libcharset submodule to incorporate the autotools-ification that I just pushed to that subproject, and builds on it by replacing Halibut's own makefile system similarly with an autotools setup. The new Makefile.am incorporates both of the old Makefile and doc/Makefile, so a single run of 'make' should now build Halibut itself and all the formats of its own documentation, which also means that the automake-generated 'make install' target can do the right thing in terms of putting an appropriate subset of those documentation formats in the assorted installation directories. The old Makefiles are gone, as is release.sh (which is now obsolete because autotools's 'make dist' doesn't do anything obviously wrong). The bob build script is comprehensively rewritten, but should still work - even the clang-based Windows build can use the autotools-generated makefile system, provided I do the libcharset build with a manual override of bin_PROGRAMS to prevent it trying to build the libcharset supporting utilities (which are not completely Windows-portable).
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile130
1 files changed, 0 insertions, 130 deletions
diff --git a/Makefile b/Makefile
deleted file mode 100644
index ba5676f..0000000
--- a/Makefile
+++ /dev/null
@@ -1,130 +0,0 @@
-# Halibut master makefile
-
-# Currently depends on gcc, because:
-# - the dependency tracking uses -MD in order to avoid needing an
-# explicit `make depend' step
-# - the definition of CFLAGS includes the gcc-specific flag
-# `-Wall'
-#
-# 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)
-endif
-else
-CFLAGS += -g
-endif
-
-ifeq (x$(VERSION)y,xy)
-RELDIR := halibut
-else
-RELDIR := halibut-$(VERSION)
-endif
-
-# `make' from top level will build in directory `build'
-# `make BUILDDIR=foo' from top level will build in directory foo
-ifndef REALBUILD
-ifndef BUILDDIR
-ifdef TEST
-BUILDDIR := test
-else
-BUILDDIR := build
-endif
-endif
-
-all install:
- @test -d $(BUILDDIR) || mkdir $(BUILDDIR)
- @$(MAKE) -C $(BUILDDIR) -f ../Makefile $@ REALBUILD=yes
-
-spotless: topclean
- @test -d $(BUILDDIR) || mkdir $(BUILDDIR)
- @$(MAKE) -C $(BUILDDIR) -f ../Makefile spotless REALBUILD=yes
-
-clean: topclean
- @test -d $(BUILDDIR) || mkdir $(BUILDDIR)
- @$(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
-# inputs/test.but').
-topclean:
- rm -f *.html output.* *.tar.gz
-
-# Makef a release archive.
-release: release.sh
- ./release.sh $(RELDIR) $(VERSION)
-
-else
-
-# The `real' makefile part.
-
-CFLAGS += -Wall -W -ansi -pedantic
-
-ifdef TEST
-CFLAGS += -DLOGALLOC
-LIBS += -lefence
-endif
-
-EXE =#
-
-all: halibut$(EXE)
-
-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-#
-MD = -MD
-CFLAGS += -I$(LIBCHARSET_SRCDIR) -I$(LIBCHARSET_OBJDIR)
-include $(LIBCHARSET_SRCDIR)Makefile
-CC_LINK = $(CC) -o $@
-
-MODULES := main malloc ustring error help licence version misc tree234
-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 winchm deflate lzx lz77 huffman psdata wcwidth
-
-OBJECTS := $(addsuffix .o,$(MODULES)) $(LIBCHARSET_OBJS)
-DEPS := $(addsuffix .d,$(MODULES))
-
-halibut$(EXE): $(OBJECTS)
- $(CC_LINK) $(LFLAGS) $(OBJECTS) $(LIBS)
-
-%.o: $(SRC)%.c
- $(CC) $(CFLAGS) -MD -c $<
-
-version.o: FORCE
- $(CC) $(CFLAGS) $(VDEF) -MD -c $(SRC)version.c
-
-spotless:: clean
- rm -f *.d
-
-clean::
- rm -f *.o halibut core
-
-install:
- mkdir -p $(prefix) $(bindir)
- $(INSTALL) -m 755 halibut $(bindir)/halibut
- $(MAKE) -C ../doc install prefix="$(prefix)" INSTALL="$(INSTALL)"
-
-FORCE: # phony target to force version.o to be rebuilt every time
-
--include $(DEPS)
-
-endif