1 # Halibut master makefile
3 # Currently depends on gcc, because:
4 # - the dependency tracking uses -MD in order to avoid needing an
5 # explicit `make depend' step
6 # - the definition of CFLAGS includes the gcc-specific flag
9 # Currently depends on GNU make, because:
10 # - the Makefile uses GNU ifdef / ifndef commands and GNU make `%'
15 bindir=$(exec_prefix)/bin
26 ifeq (x
$(VERSION
)y
,xy
)
29 RELDIR
:= halibut-
$(VERSION
)
32 # `make' from top level will build in directory `build'
33 # `make BUILDDIR=foo' from top level will build in directory foo
44 @
test -d
$(BUILDDIR
) || mkdir
$(BUILDDIR
)
45 @
$(MAKE
) -C
$(BUILDDIR
) -f ..
/Makefile
$@ REALBUILD
=yes
48 @
test -d
$(BUILDDIR
) || mkdir
$(BUILDDIR
)
49 @
$(MAKE
) -C
$(BUILDDIR
) -f ..
/Makefile spotless REALBUILD
=yes
52 @
test -d
$(BUILDDIR
) || mkdir
$(BUILDDIR
)
53 @
$(MAKE
) -C
$(BUILDDIR
) -f ..
/Makefile
clean REALBUILD
=yes
55 # Remove Halibut output files in the source directory (may
56 # have been created by running, for example, `build/halibut
59 rm -f
*.html output.
* *.
tar.gz
61 # Make a release archive. If $(VERSION) is specified, this will
62 # also contain a `manifest' file which will be used to decide the
63 # version number automatically.
65 .
/release.sh
$(RELDIR
) $(VERSION
)
69 # The `real' makefile part.
84 VDEF
= -DVERSION
=\"$(VER
)\"
86 VDEF
= `(cd $(SRC); md5sum -c manifest && cat version)`
93 ifeq ($(shell test -d
$(SRC
)charset
&& echo yes
),yes
)
94 LIBCHARSET_SRCDIR
= $(SRC
)charset
/
96 LIBCHARSET_SRCDIR
= $(SRC
)..
/charset
/
98 LIBCHARSET_OBJDIR
= .
/#
99 LIBCHARSET_OBJPFX
= cs-
#
100 LIBCHARSET_GENPFX
= charset-
#
102 CFLAGS
+= -I
$(LIBCHARSET_SRCDIR
) -I
$(LIBCHARSET_OBJDIR
)
103 include $(LIBCHARSET_SRCDIR
)Makefile
105 MODULES
:= main malloc ustring error help licence version misc tree234
106 MODULES
+= input keywords contents index style biblio
107 MODULES
+= bk_text bk_html bk_whlp bk_man bk_info bk_paper bk_ps bk_pdf
108 MODULES
+= winhelp psdata wcwidth
110 OBJECTS
:= $(addsuffix .o
,$(MODULES
)) $(LIBCHARSET_OBJS
)
111 DEPS
:= $(addsuffix .d
,$(MODULES
))
114 $(CC
) $(LFLAGS
) -o halibut
$(OBJECTS
) $(LIBS
)
117 $(CC
) $(CFLAGS
) -MD
-c
$<
120 $(CC
) $(VDEF
) -MD
-c
$(SRC
)version.c
126 rm -f
*.o halibut core
129 $(INSTALL
) -m
755 halibut
$(bindir)/halibut
130 $(MAKE
) -C ..
/doc
install prefix="$(prefix)" INSTALL
="$(INSTALL)"
132 FORCE
: # phony target to force version.o to be rebuilt every time