Move all docs management from Rules.mk to docs/Makefile, to avoid conflists between variables (SOURCES, OBJS, ...)

Signed-off-by: Laurent Vivier <Laurent@lvivier.info>
This commit is contained in:
Laurent Vivier 2008-09-05 14:20:41 +02:00
parent e1d621532a
commit c5268fb299
2 changed files with 23 additions and 5 deletions

View File

@ -3,11 +3,10 @@
#
OBJS = $(patsubst %.S,%.o,$(SOURCES:.c=.o))
MANPAGES = $(SECTION5:.sgml=.5.gz) $(SECTION8:.sgml=.8.gz)
MODULE ?= $(shell basename $(TOP))
DISTFILES ?= $(SOURCES) $(SECTION5) $(SECTION8) $(HEADERS) Makefile
DISTFILES ?= $(SOURCES) $(HEADERS) Makefile
$(LIBRARY): $(LIBRARY)($(patsubst %.S,%.o,$(SOURCES:.c=.o)))
@ -29,6 +28,5 @@ clean:
(cd $(TARGET) && rm -f $(OBJS) $(PROGRAMS) $(LIBRARY)) || true
else
clean:
rm -f $(OBJS) $(PROGRAMS) $(LIBRARY) $(CLEAN) $(LIBRARIES) \
$(MANPAGES) $(MANPAGES:.8.gz=.8) $(MANPAGES:.5.gz=.5)
rm -f $(OBJS) $(PROGRAMS) $(LIBRARY) $(CLEAN) $(LIBRARIES)
endif

View File

@ -5,6 +5,8 @@
TOP=$(shell pwd)
MODULE ?= $(shell basename $(TOP))
SECTION5 = emile.conf.sgml
SECTION8 = emile-first-tune.sgml emile-install.sgml emile-map-set.sgml \
@ -13,9 +15,14 @@ SECTION8 = emile-first-tune.sgml emile-install.sgml emile-map-set.sgml \
MANPATH ?= /usr/share/man/
MANPAGES = $(SECTION5:.sgml=.5.gz) $(SECTION8:.sgml=.8.gz)
DISTFILES ?= $(SECTION5) $(SECTION8) Makefile
all: man
include $(TOP)/../Rules.mk
%.gz: %
gzip -9f $<
man: $(MANPAGES)
@ -35,4 +42,17 @@ uninstall:
rm -f $(DESTDIR)/$(PREFIX)/$(MANPATH)/man8/$${file}; \
done
clean:
rm -f $(MANPAGES) $(MANPAGES:.8.gz=.8) $(MANPAGES:.5.gz=.5)
dist:
@echo TAR $(MODULE)
@for file in $(DISTFILES); do \
dir=$$(dirname $$file); \
if [ "$$dir" != "" ] ; then \
mkdir -p $(DISTDIR)/$(MODULE)/$$dir; \
fi; \
cp -p $$file $(DISTDIR)/$(MODULE)/$$file; \
done
include $(TOP)/../tools.mk