make-dfsg/maintMakefile

87 lines
2.8 KiB
Text
Raw Normal View History

1997-08-18 18:11:04 +00:00
# Maintainer-only makefile segment. This contains things that are relevant
# only if you have the full copy of the GNU make sources, not a dist copy.
#
# Find the glob source files... this might be dangerous, but we're maintainers!
#
globsrc := $(wildcard glob/*.c)
1997-08-27 20:30:54 +00:00
globhdr := $(wildcard glob/*.h)
1998-07-30 20:54:47 +00:00
TEMPLATES = README README.DOS config.ami configh.dos config.h.W32 config.h-vms
MTEMPLATES = Makefile.DOS SMakefile
1997-08-18 18:11:04 +00:00
# General rule for turning a .template into a regular file.
#
1997-08-27 20:30:54 +00:00
$(TEMPLATES) : % : %.template configure.in
rm -f $@
sed -e 's@%VERSION%@$(VERSION)@' \
-e 's@%PACKAGE%@$(PACKAGE)@' \
$< > $@
chmod a-w $@
1998-07-30 20:54:47 +00:00
# Construct Makefiles by adding on dependencies, etc.
1997-08-27 20:30:54 +00:00
#
1998-07-30 20:54:47 +00:00
$(MTEMPLATES) : % : %.template .dep_segment Makefile.am maintMakefile
1997-08-18 18:11:04 +00:00
rm -f $@
1997-08-27 20:30:54 +00:00
sed -e 's@%VERSION%@$(VERSION)@' \
-e 's@%PROGRAMS%@$(bin_PROGRAMS)@' \
-e 's@%SOURCES%@$(filter-out remote-%,$(make_SOURCES)) remote-$$(REMOTE).c@' \
-e 's@%OBJECTS%@$(filter-out remote-%,$(make_OBJECTS)) remote-$$(REMOTE).o@' \
-e 's@%GLOB_SOURCES%@$(globsrc) $(globhdr)@' \
-e 's@%GLOB_OBJECTS%@$(globsrc:glob/%.c=%.o)@' \
$< > $@
1998-07-30 20:54:47 +00:00
echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
cat $(word 2,$^) >>$@
chmod a-w $@
NMakefile: NMakefile.template .dep_segment Makefile.am maintMakefile
rm -f $@
cp $< $@
echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
sed 's/^\([^ ]*\)\.o:/$$(OUTDIR)\/\1.obj:/' $(word 2,$^) >>$@
1997-08-18 18:11:04 +00:00
chmod a-w $@
# Construct build.sh.in
#
1998-07-30 20:54:47 +00:00
build.sh.in: build.template Makefile.am maintMakefile
1997-08-18 18:11:04 +00:00
rm -f $@
sed -e 's@%objs%@$(filter-out remote-%, $(make_OBJECTS)\
$(patsubst %.c,%.o,$(globsrc)))@' \
$< > $@
chmod a-w+x $@
1998-07-30 20:54:47 +00:00
# Use automake to build a dependency list file, for "foreign" makefiles like
# Makefile.DOS.
#
.dep_segment: Makefile.am maintMakefile $(DEP_FILES)
$(AUTOMAKE) --generate-deps --build-dir=. --srcdir-name=.
1997-09-16 14:17:23 +00:00
# We clean everything here. The GNU standards for makefile conventions say
# you shouldn't remove configure, etc., but this makefile is only available
# in a full development distribution, so they'll only be removed then.
#
1997-09-19 19:47:55 +00:00
# And _I_ want them to be removed ;)
#
1998-07-30 20:54:47 +00:00
maintFILES = configure aclocal.m4 config.h.in Makefile.in stamp-h.in \
glob/configure glob/aclocal.m4 glob/config.h.in glob/Makefile.in \
glob/stamp-h.in
1997-09-19 19:47:55 +00:00
1998-07-30 20:54:47 +00:00
MAINTAINERCLEANFILES = $(maintFILES) $(TEMPLATES) $(MTEMPLATES) NMakefile \
missing build.sh.in .dep_segment
1997-09-16 14:17:23 +00:00
1997-08-18 18:11:04 +00:00
# Put the alpha distribution files up for anonymous FTP.
#
ALPHA := ~ftp/gnu
TARFILE := $(distdir).tar.gz
.PHONY: alpha
alpha: $(ALPHA) $(TARFILE)
@rm -f $(ALPHA)/$(TARFILE)
cp -p $(TARFILE) $(ALPHA)
1998-07-30 20:54:47 +00:00
# This is needed because normal builds with GCC don't compile alloca.c, so
# alloca.P doesn't get built :-/.
#
.deps/alloca.P: alloca.c
$(COMPILE) -M -o $@ $<