1 # Maintainer-only makefile segment. This contains things that are relevant
2 # only if you have the full copy of the GNU make sources from the CVS
3 # tree, not a dist copy.
6 # Find the glob source files... this might be dangerous, but we're maintainers!
8 globsrc := $(wildcard glob/*.c)
9 globhdr := $(wildcard glob/*.h)
11 TEMPLATES = README README.DOS config.ami configh.dos config.h.W32 config.h-vms
12 MTEMPLATES = Makefile.DOS SMakefile
14 # We need this to ensure that README is created on time to avoid errors
19 # General rule for turning a .template into a regular file.
21 $(TEMPLATES) : % : %.template configure.in
23 sed -e 's@%VERSION%@$(VERSION)@' \
24 -e 's@%PACKAGE%@$(PACKAGE)@' \
28 # Construct Makefiles by adding on dependencies, etc.
30 $(MTEMPLATES) : % : %.template .dep_segment Makefile.am maintMakefile
32 sed -e 's@%VERSION%@$(VERSION)@' \
33 -e 's@%PROGRAMS%@$(bin_PROGRAMS)@' \
34 -e 's@%SOURCES%@$(filter-out remote-%,$(make_SOURCES)) remote-$$(REMOTE).c@' \
35 -e 's@%OBJECTS%@$(filter-out remote-%,$(make_OBJECTS)) remote-$$(REMOTE).o@' \
36 -e 's@%GLOB_SOURCES%@$(globsrc) $(globhdr)@' \
37 -e 's@%GLOB_OBJECTS%@$(globsrc:glob/%.c=%.o)@' \
39 echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
43 NMakefile: NMakefile.template .dep_segment Makefile.am maintMakefile
46 echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
47 sed 's/^\([^ ]*\)\.o:/$$(OUTDIR)\/\1.obj:/' $(word 2,$^) >>$@
50 # Construct build.sh.in
52 build.sh.in: build.template Makefile.am maintMakefile
54 sed -e 's@%objs%@$(filter-out remote-%, $(make_OBJECTS)@' \
55 -e 's@%globobjs%@$(patsubst %.c,%.o,$(globsrc)))@' \
59 # Use automake to build a dependency list file, for "foreign" makefiles like
62 .dep_segment: Makefile.am maintMakefile $(DEP_FILES)
63 $(AUTOMAKE) --generate-deps --build-dir=. --srcdir-name=.
65 # We clean everything here. The GNU standards for makefile conventions say
66 # you shouldn't remove configure, etc., but this makefile is only available
67 # in a full development distribution, so they'll only be removed then.
69 # And _I_ want them to be removed ;)
71 maintFILES = configure aclocal.m4 config.h.in Makefile.in stamp-h.in
73 MAINTAINERCLEANFILES = $(maintFILES) $(TEMPLATES) $(MTEMPLATES) NMakefile \
74 missing build.sh.in .dep_segment
76 # Put the alpha distribution files up for anonymous FTP.
79 TARFILE := $(distdir).tar.gz
82 alpha: $(ALPHA) $(TARFILE)
83 @rm -f $(ALPHA)/$(TARFILE)
84 cp -p $(TARFILE) $(ALPHA)
86 # This is needed because normal builds with GCC don't compile alloca.c, so
87 # alloca.P doesn't get built :-/.
89 .deps/alloca.P: alloca.c
90 $(COMPILE) -M -o $@ $<