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 README.W32 \
12 config.ami configh.dos config.h.W32 config.h-vms
13 MTEMPLATES = Makefile.DOS SMakefile
15 # We need this to ensure that README and build.sh.in are created on time to
16 # avoid errors by automake.
18 #Makefile.in: README build.sh.in
20 # General rule for turning a .template into a regular file.
22 $(TEMPLATES) : % : %.template Makefile
24 sed -e 's@%VERSION%@$(VERSION)@g' \
25 -e 's@%PACKAGE%@$(PACKAGE)@g' \
29 # Construct Makefiles by adding on dependencies, etc.
31 $(MTEMPLATES) : % : %.template .dep_segment Makefile
33 sed -e 's@%VERSION%@$(VERSION)@g' \
34 -e 's@%PROGRAMS%@$(bin_PROGRAMS)@g' \
35 -e 's@%SOURCES%@$(filter-out remote-%,$(make_SOURCES)) remote-$$(REMOTE).c@g' \
36 -e 's@%OBJECTS%@$(filter-out remote-%,$(make_OBJECTS)) remote-$$(REMOTE).o@g' \
37 -e 's@%GLOB_SOURCES%@$(globsrc) $(globhdr)@g' \
38 -e 's@%GLOB_OBJECTS%@$(globsrc:glob/%.c=%.o)@g' \
40 echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
44 NMakefile: NMakefile.template .dep_segment Makefile
47 echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
48 sed 's/^\([^ ]*\)\.o:/$$(OUTDIR)\/\1.obj:/' $(word 2,$^) >>$@
51 # Construct build.sh.in
53 build.sh.in: build.template Makefile
55 sed -e 's@%objs%@$(filter-out remote-%,$(make_OBJECTS)@g' \
56 -e 's@%globobjs%@$(patsubst %.c,%.o,$(globsrc)))@g' \
60 # Use automake to build a dependency list file, for "foreign" makefiles like
63 .dep_segment: Makefile.am maintMakefile $(DEP_FILES)
64 $(AUTOMAKE) --generate-deps --build-dir=. --srcdir-name=.
66 # We clean everything here. The GNU standards for makefile conventions say
67 # you shouldn't remove configure, etc., but this makefile is only available
68 # in a full development distribution, so they'll only be removed then.
70 # And _I_ want them to be removed ;)
72 maintFILES = configure aclocal.m4 config.h.in Makefile.in stamp-h.in
74 MAINTAINERCLEANFILES = $(maintFILES) $(TEMPLATES) $(MTEMPLATES) NMakefile \
75 missing build.sh.in .dep_segment
77 # Put the alpha distribution files up for anonymous FTP.
80 TARFILE := $(distdir).tar.gz
83 alpha: $(ALPHA) $(TARFILE)
84 @rm -f $(ALPHA)/$(TARFILE)
85 cp -p $(TARFILE) $(ALPHA)
87 # This is needed because normal builds with GCC don't compile alloca.c, so
88 # alloca.P doesn't get built :-/.
90 .deps/alloca.P: alloca.c
91 $(COMPILE) -M -o $@ $<