If a file declared .INTERMEDIATE already exists before make starts, we
[make.git] / maintMakefile
blob939e19f54aa6a65e74761b78a81e6058084a098d
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
15 # by automake.
17 Makefile.in: README
19 # General rule for turning a .template into a regular file.
21 $(TEMPLATES) : % : %.template configure.in
22         rm -f $@
23         sed -e 's@%VERSION%@$(VERSION)@' \
24             -e 's@%PACKAGE%@$(PACKAGE)@' \
25           $< > $@
26         chmod a-w $@
28 # Construct Makefiles by adding on dependencies, etc.
30 $(MTEMPLATES) : % : %.template .dep_segment Makefile.am maintMakefile
31         rm -f $@
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)@' \
38           $< > $@
39         echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
40           cat $(word 2,$^) >>$@
41         chmod a-w $@
43 NMakefile: NMakefile.template .dep_segment Makefile.am maintMakefile
44         rm -f $@
45         cp $< $@
46         echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
47           sed 's/^\([^ ]*\)\.o:/$$(OUTDIR)\/\1.obj:/' $(word 2,$^) >>$@
48         chmod a-w $@
50 # Construct build.sh.in
52 build.sh.in: build.template Makefile.am maintMakefile
53         rm -f $@
54         sed -e 's@%objs%@$(filter-out remote-%, $(make_OBJECTS)@' \
55             -e 's@%globobjs%@$(patsubst %.c,%.o,$(globsrc)))@' \
56           $< > $@
57         chmod a-w+x $@
59 # Use automake to build a dependency list file, for "foreign" makefiles like
60 # Makefile.DOS.
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.
78 ALPHA   := ~ftp/gnu
79 TARFILE := $(distdir).tar.gz
81 .PHONY: alpha
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 $@ $<