(install, install-html): Implement. Closes #913154.

(installdirs): New.
This commit is contained in:
Markus Armbruster 2005-12-23 17:58:19 +00:00
parent 1bf21d048a
commit 90def7cb85
2 changed files with 51 additions and 16 deletions

View file

@ -68,6 +68,7 @@ RANLIB := @RANLIB@
prefix := @prefix@ prefix := @prefix@
exec_prefix := @exec_prefix@ exec_prefix := @exec_prefix@
bindir := @bindir@ bindir := @bindir@
sbindir := @sbindir@
datadir := @datadir@ datadir := @datadir@
localstatedir := @localstatedir@ localstatedir := @localstatedir@
mandir := @mandir@ mandir := @mandir@
@ -78,13 +79,7 @@ VPATH := @srcdir@
cvs_controlled := @cvs_controlled@ cvs_controlled := @cvs_controlled@
# Recursively expanded so that $@ and $< work. EMPIREHOST := @EMPIREHOST@
subst.in = sed \ EMPIREPORT := @EMPIREPORT@
-e 's?@configure_input\@?$(notdir $@). Generated from $(notdir $<) by GNUmakefile.?g' \
-e 's?@econfig\@?$(sysconfdir)/empire/econfig?g' \
-e 's?@edatadir\@?$(localstatedir)/empire?g' \
-e 's?@einfodir\@?$(datadir)/empire/info.nr?g' \
-e 's/@EMPIREHOST\@/@EMPIREHOST@/g' \
-e 's/@EMPIREPORT\@/@EMPIREPORT@/g'
include $(srcdir)/Make.mk include $(srcdir)/Make.mk

56
Make.mk
View file

@ -47,6 +47,8 @@
dirs := $(sort $(dir $(src))) dirs := $(sort $(dir $(src)))
csrc := $(filter %.c, $(src)) csrc := $(filter %.c, $(src))
tsrc := $(filter %.t, $(src)) tsrc := $(filter %.t, $(src))
man1 := $(filter man/%.1, $(src))
man6 := $(filter man/%.6, $(src))
# Info topics and subjects # Info topics and subjects
-include subjects.mk -include subjects.mk
@ -62,7 +64,9 @@ obj := $(csrc:.c=.o) $(filter %.o, $(ac:.c=.o))
deps := $(obj:.o=.d) deps := $(obj:.o=.d)
libs := $(addprefix lib/, libcommon.a libgen.a libglobal.a) libs := $(addprefix lib/, libcommon.a libgen.a libglobal.a)
util := $(addprefix src/util/, fairland files pconfig) util := $(addprefix src/util/, fairland files pconfig)
progs := $(util) src/client/empire src/server/emp_server client := src/client/empire
server := src/server/emp_server
progs := $(util) $(client) $(server)
tsubj := $(addprefix info/, $(addsuffix .t, $(subjects))) tsubj := $(addprefix info/, $(addsuffix .t, $(subjects)))
ttop := info/TOP.t ttop := info/TOP.t
info.nr := $(addprefix info.nr/, $(info)) info.nr := $(addprefix info.nr/, $(info))
@ -84,6 +88,18 @@ depcomp = $(SHELL) $(top_srcdir)/depcomp
clean := $(obj) $(deps) $(libs) $(progs) $(empth_lib) $(tsubj) \ clean := $(obj) $(deps) $(libs) $(progs) $(empth_lib) $(tsubj) \
$(info.nr) $(info.html) $(info.nr) $(info.html)
distclean := $(ac) info/stamp $(ttop) distclean := $(ac) info/stamp $(ttop)
econfig := $(sysconfdir)/empire/econfig
edatadir := $(localstatedir)/empire
einfodir := $(datadir)/empire/info.nr
ehtmldir := $(datadir)/empire/info.html
# Recursively expanded so that $@ and $< work.
subst.in = sed \
-e 's?@configure_input\@?$(notdir $@). Generated from $(notdir $<) by GNUmakefile.?g' \
-e 's?@econfig\@?$(econfig)?g' \
-e 's?@edatadir\@?$(edatadir)?g' \
-e 's?@einfodir\@?$(einfodir)?g' \
-e 's/@EMPIREHOST\@/$(EMPIREHOST)/g' \
-e 's/@EMPIREPORT\@/$(EMPIREPORT)/g'
# Compiler flags # Compiler flags
CPPFLAGS += -I$(srcdir)/include -Iinclude CPPFLAGS += -I$(srcdir)/include -Iinclude
@ -111,11 +127,34 @@ clean:
distclean: clean distclean: clean
rm -rf $(distclean) rm -rf $(distclean)
.PHONY: install install-html .PHONY: install
install: all install: all installdirs
false # FIXME $(INSTALL_PROGRAM) $(util) $(server) $(sbindir)
install-html: html $(INSTALL_PROGRAM) $(client) $(bindir)
false # FIXME $(INSTALL_DATA) $(info.nr) $(einfodir)
$(INSTALL_DATA) $(addprefix $(srcdir)/, $(man1)) $(mandir)/man1
$(INSTALL_DATA) $(addprefix $(srcdir)/, $(man6)) $(mandir)/man6
if test -e $(econfig); then \
if src/util/pconfig $(econfig) >$(econfig).new; then \
if cmp -s $(econfig) $(econfig).new; then \
rm $(econfig).new; \
else \
echo "Check out $(econfig).new"; \
fi \
else \
echo "Your $(econfig) doesn't work"; \
fi \
else \
src/util/pconfig >$(econfig); \
fi
.PHONY: installdirs
installdirs:
mkdir -p $(bindir) $(sbindir) $(edatadir) $(einfodir) $(mandir)/man1 $(mandir)/man6 $(dir $(econfig))
.PHONY: install-html
install-html: html | $(ehtmldir)
$(INSTALL_DATA) $(info.html) $(ehtmldir)
.PHONY: uninstall .PHONY: uninstall
uninstall: uninstall:
@ -153,10 +192,10 @@ info.html/%.html: info/%.t
### Explicit rules ### Explicit rules
src/server/emp_server: $(filter src/server/% src/lib/as/% src/lib/commands/% src/lib/player/% src/lib/subs/% src/lib/update/%, $(obj)) $(empth_obj) $(libs) $(empth_lib) $(server): $(filter src/server/% src/lib/as/% src/lib/commands/% src/lib/player/% src/lib/subs/% src/lib/update/%, $(obj)) $(empth_obj) $(libs) $(empth_lib)
$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@ $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
src/client/empire: $(filter src/client/%, $(obj)) $(termlibs) $(client): $(filter src/client/%, $(obj)) $(termlibs)
$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@ $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
$(util): $(libs) $(util): $(libs)
@ -180,6 +219,7 @@ $(libs) $(empth_lib): | lib
# multiple targets does what we want. So we artificially turn the # multiple targets does what we want. So we artificially turn the
# explicit rule into a pattern rule: we replace info with %, and # explicit rule into a pattern rule: we replace info with %, and
# insert a touch target info/stamp. # insert a touch target info/stamp.
# FIXME if sources.mk is out-of-date, $(tsubj) is, and the bogus deps can prevent remaking of subjects.mk and thus sources.mk
$(patsubst info/%, \%/%, $(ttop) $(tsubj)): %/stamp $(patsubst info/%, \%/%, $(ttop) $(tsubj)): %/stamp
perl $(srcdir)/info/info.pl perl $(srcdir)/info/info.pl
info/stamp: $(tsrc) info/info.pl sources.mk info/stamp: $(tsrc) info/info.pl sources.mk