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 `%'
21 ifeq (x
$(VERSION
)y
,xy
)
24 RELDIR
:= halibut-
$(VERSION
)
27 # `make' from top level will build in directory `build'
28 # `make BUILDDIR=foo' from top level will build in directory foo
39 @
test -d
$(BUILDDIR
) || mkdir
$(BUILDDIR
)
40 @make
-C
$(BUILDDIR
) -f ..
/Makefile REALBUILD
=yes
43 @
test -d
$(BUILDDIR
) || mkdir
$(BUILDDIR
)
44 @make
-C
$(BUILDDIR
) -f ..
/Makefile spotless REALBUILD
=yes
47 @
test -d
$(BUILDDIR
) || mkdir
$(BUILDDIR
)
48 @make
-C
$(BUILDDIR
) -f ..
/Makefile
clean REALBUILD
=yes
50 # Remove Halibut output files in the source directory (may
51 # have been created by running, for example, `build/halibut
54 rm -f
*.html output.
* *.
tar.gz
56 # Make a release archive. If $(VERSION) is specified, this will
57 # also contain a `manifest' file which will be used to decide the
58 # version number automatically.
60 find .
-name CVS
-prune
-o
-name build
-prune
-o
-name reltmp
-prune \
61 -o
-type d
-exec mkdir
-p reltmp
/$(RELDIR
)/{} \
;
62 find .
-name CVS
-prune
-o
-name build
-prune
-o
-name reltmp
-prune \
63 -o
-name
'*.orig' -prune
-o
-name
'*.rej' -prune \
64 -o
-name
'*.txt' -prune
-o
-name
'*.html' -prune \
65 -o
-name
'*.1' -prune
-o
-name
'.cvsignore' -prune \
66 -o
-name
'*.gz' -prune
-o
-name
'.[^.]*' -prune \
67 -o
-type f
-exec ln
-s
$(PWD
)/{} reltmp
/$(RELDIR
)/{} \
;
68 if
test "x$(VERSION)y" != "xy"; then \
69 (cd reltmp
/$(RELDIR
); \
70 find .
-name
'*.[ch]' -exec md5sum
{} \
; \
71 ) > reltmp
/$(RELDIR
)/manifest
; \
72 echo
"-DVERSION=\"$(VERSION)\"" > reltmp
/$(RELDIR
)/version
; \
74 tar chzvCf reltmp
- $(RELDIR
) > $(RELDIR
).
tar.gz
79 # The `real' makefile part.
94 VDEF
= -DVERSION
=\"$(VER
)\"
96 VDEF
= `(cd $(SRC); md5sum -c manifest && cat version)`
101 MODULES
:= main malloc ustring error help licence version misc tree234
102 MODULES
+= input keywords contents index style biblio
103 MODULES
+= bk_text bk_xhtml bk_whlp bk_man bk_info bk_paper bk_ps bk_pdf
104 MODULES
+= winhelp psdata
106 OBJECTS
:= $(addsuffix .o
,$(MODULES
))
107 DEPS
:= $(addsuffix .d
,$(MODULES
))
110 $(CC
) $(LFLAGS
) -o halibut
$(OBJECTS
) $(LIBS
)
113 $(CC
) $(CFLAGS
) -MD
-c
$<
116 $(CC
) $(VDEF
) -MD
-c
$(SRC
)version.c
122 rm -f
*.o halibut core
124 FORCE
: # phony target to force version.o to be rebuilt every time