* Some DOS fixes.
[make.git] / maintMakefile
blobc95371785116f59df73bdb15e92b70d091742fa0
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 and build.sh.in are created on time to
15 # avoid errors by automake.
17 #Makefile.in: README build.sh.in
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)@g' \
24             -e 's@%PACKAGE%@$(PACKAGE)@g' \
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)@g' \
33             -e 's@%PROGRAMS%@$(bin_PROGRAMS)@g' \
34             -e 's@%SOURCES%@$(filter-out remote-%,$(make_SOURCES)) remote-$$(REMOTE).c@g' \
35             -e 's@%OBJECTS%@$(filter-out remote-%,$(make_OBJECTS)) remote-$$(REMOTE).o@g' \
36             -e 's@%GLOB_SOURCES%@$(globsrc) $(globhdr)@g' \
37             -e 's@%GLOB_OBJECTS%@$(globsrc:glob/%.c=%.o)@g' \
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)@g' \
55             -e 's@%globobjs%@$(patsubst %.c,%.o,$(globsrc)))@g' \
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 $@ $<