summaryrefslogtreecommitdiff
path: root/maintMakefile
blob: 5aab784b0283b41a2d1c6fc5afe2cb1d0330b8b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# 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)
globhdr := $(wildcard glob/*.h)

TEMPLATES = README config.ami configh.dos config.h.W32 config.h-vms

# General rule for turning a .template into a regular file.
#
$(TEMPLATES) : % : %.template configure.in
	rm -f $@
	sed -e 's@%VERSION%@$(VERSION)@' \
	    -e 's@%PACKAGE%@$(PACKAGE)@' \
	  $< > $@
	chmod a-w $@

# Construct Makefile.DOS
#
Makefile.DOS: Makefile.DOS.template Makefile.am configure.in
	rm -f $@
	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)@' \
	  $< > $@
	chmod a-w $@

# Construct build.sh.in
#
build.sh.in: build.template Makefile.am
	rm -f $@
	sed -e 's@%objs%@$(filter-out remote-%, $(make_OBJECTS)\
	       $(patsubst %.c,%.o,$(globsrc)))@' \
	    $< > $@
	chmod a-w+x $@

# 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.
#
# And _I_ want them to be removed ;)
#
maintFILES = configure aclocal.m4 config.h.in Makefile.in \
	     stamp-h.in glob/stamp-h.in

MAINTAINERCLEANFILES =  $(TEMPLATES) missing Makefile.DOS build.sh.in \
			$(maintFILES)

# 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)