Slightly improve the handling of headings in HTML single-file mode.
[sgt/halibut] / Makefile
CommitLineData
d7482997 1# Halibut master makefile
2
3# Requires a compiler with -MD support, currently
4
5# `make' from top level will build in directory `build'
6# `make BUILDDIR=foo' from top level will build in directory foo
7ifndef REALBUILD
8ifndef BUILDDIR
9ifdef TEST
10BUILDDIR := test
11else
12BUILDDIR := build
13endif
14endif
15all:
16 @test -d $(BUILDDIR) || mkdir $(BUILDDIR)
17 @make -C $(BUILDDIR) -f ../Makefile REALBUILD=yes
18spotless:
19 @test -d $(BUILDDIR) || mkdir $(BUILDDIR)
20 @make -C $(BUILDDIR) -f ../Makefile spotless REALBUILD=yes
21clean:
22 @test -d $(BUILDDIR) || mkdir $(BUILDDIR)
23 @make -C $(BUILDDIR) -f ../Makefile clean REALBUILD=yes
24else
25
26# The `real' makefile part.
27
28CFLAGS += -Wall -W
29
30ifdef TEST
31CFLAGS += -DLOGALLOC
32LIBS += -lefence
33endif
34
35ifdef RELEASE
36ifndef VERSION
37VERSION := $(RELEASE)
38endif
39else
40CFLAGS += -g
41endif
42
43ifndef VER
44ifdef VERSION
45VER := $(VERSION)
46endif
47endif
48ifdef VER
49VDEF := -DVERSION=\"$(VER)\"
50endif
51
52SRC := ../
53
54MODULES := main malloc ustring error help licence version misc tree234
55MODULES += input keywords contents index style biblio
56MODULES += bk_text bk_xhtml bk_whlp
57MODULES += winhelp
58
59OBJECTS := $(addsuffix .o,$(MODULES))
60DEPS := $(addsuffix .d,$(MODULES))
61
62halibut: $(OBJECTS)
63 $(CC) $(LFLAGS) -o halibut $(OBJECTS) $(LIBS)
64
65%.o: $(SRC)%.c
66 $(CC) $(CFLAGS) -MD -c $<
67
68version.o: FORCE
69 $(CC) $(VDEF) -MD -c $(SRC)version.c
70
71spotless:: clean
72 rm -f *.d
73
74clean::
75 rm -f *.o halibut core
76
77FORCE: # phony target to force version.o to be rebuilt every time
78
79-include $(DEPS)
80
81endif