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 `%'
16 bindir=$(exec_prefix)/bin
19 .PHONY
: all install clean spotless topclean release
29 ifeq (x
$(VERSION
)y
,xy
)
32 RELDIR
:= halibut-
$(VERSION
)
35 # `make' from top level will build in directory `build'
36 # `make BUILDDIR=foo' from top level will build in directory foo
47 @
test -d
$(BUILDDIR
) || mkdir
$(BUILDDIR
)
48 @
$(MAKE
) -C
$(BUILDDIR
) -f ..
/Makefile
$@ REALBUILD
=yes
51 @
test -d
$(BUILDDIR
) || mkdir
$(BUILDDIR
)
52 @
$(MAKE
) -C
$(BUILDDIR
) -f ..
/Makefile spotless REALBUILD
=yes
55 @
test -d
$(BUILDDIR
) || mkdir
$(BUILDDIR
)
56 @
$(MAKE
) -C
$(BUILDDIR
) -f ..
/Makefile
clean REALBUILD
=yes
58 # Remove Halibut output files in the source directory (may
59 # have been created by running, for example, `build/halibut
62 rm -f
*.html output.
* *.
tar.gz
64 # Make a release archive. If $(VERSION) is specified, this will
65 # also contain a `manifest' file which will be used to decide the
66 # version number automatically.
68 .
/release.sh
$(RELDIR
) $(VERSION
)
72 # The `real' makefile part.
74 CFLAGS
+= -Wall
-W
-ansi
-pedantic
87 VDEF
= -DVERSION
=\"$(VER
)\"
89 VDEF
= `(cd $(SRC); md5sum -c manifest >& /dev/null && cat version)`
96 ifeq ($(shell test -d
$(SRC
)charset
&& echo yes
),yes
)
97 LIBCHARSET_SRCDIR
= $(SRC
)charset
/
99 LIBCHARSET_SRCDIR
= $(SRC
)..
/charset
/
101 LIBCHARSET_OBJDIR
= .
/#
102 LIBCHARSET_OBJPFX
= cs-
#
103 LIBCHARSET_GENPFX
= charset-
#
105 CFLAGS
+= -I
$(LIBCHARSET_SRCDIR
) -I
$(LIBCHARSET_OBJDIR
)
106 include $(LIBCHARSET_SRCDIR
)Makefile
108 MODULES
:= main malloc ustring error help licence version misc tree234
109 MODULES
+= input in_afm in_pf in_sfnt keywords contents index biblio
110 MODULES
+= bk_text bk_html bk_whlp bk_man bk_info bk_paper bk_ps bk_pdf
111 MODULES
+= winhelp deflate psdata wcwidth
113 OBJECTS
:= $(addsuffix .o
,$(MODULES
)) $(LIBCHARSET_OBJS
)
114 DEPS
:= $(addsuffix .d
,$(MODULES
))
117 $(CC
) $(LFLAGS
) -o halibut
$(OBJECTS
) $(LIBS
)
120 $(CC
) $(CFLAGS
) -MD
-c
$<
123 $(CC
) $(VDEF
) -MD
-c
$(SRC
)version.c
129 rm -f
*.o halibut core
132 $(INSTALL
) -m
755 halibut
$(bindir)/halibut
133 $(MAKE
) -C ..
/doc
install prefix="$(prefix)" INSTALL
="$(INSTALL)"
135 FORCE
: # phony target to force version.o to be rebuilt every time