Blob


2 # this works in gnu make
3 SYSNAME:=${shell uname}
4 OBJTYPE:=${shell uname -m | sed 's;i.86;386;; s;/.*;;; s; ;;g'}
6 # this works in bsd make
7 SYSNAME!=uname
8 OBJTYPE!=uname -m | sed 's;i.86;386;; s;/.*;;; s; ;;g'
10 # the gnu rules will mess up bsd but not vice versa,
11 # hence the gnu rules come first.
13 include Make.$(SYSNAME)-$(OBJTYPE)
15 PREFIX=/usr/local
17 NUKEFILES=
19 TGZFILES=
21 TARG=mk
22 VERSION=2.0
23 PORTPLACE=devel/mk
24 NAME=mk
26 OFILES=\
27 arc.$O\
28 archive.$O\
29 bufblock.$O\
30 env.$O\
31 file.$O\
32 graph.$O\
33 job.$O\
34 lex.$O\
35 main.$O\
36 match.$O\
37 mk.$O\
38 parse.$O\
39 recipe.$O\
40 rule.$O\
41 run.$O\
42 sh.$O\
43 shprint.$O\
44 symtab.$O\
45 var.$O\
46 varsub.$O\
47 word.$O\
48 unix.$O\
50 HFILES=\
51 mk.h\
52 fns.h\
54 all: $(TARG)
56 TGZFILES+=mk.pdf
58 install: $(LIB)
59 test -d $(PREFIX)/man/man1 || mkdir $(PREFIX)/man/man1
60 test -d $(PREFIX)/doc || mkdir $(PREFIX)/doc
61 install -m 0755 mk $(PREFIX)/bin/mk
62 cat mk.1 | sed 's;DOCPREFIX;$(PREFIX);g' >mk.1a
63 install -m 0644 mk.1a $(PREFIX)/man/man1/mk.1
64 install -m 0644 mk.pdf $(PREFIX)/doc/mk.pdf
67 $(TARG): $(OFILES)
68 $(CC) -o $(TARG) $(OFILES) -L$(PREFIX)/lib -lregexp9 -lbio -lfmt -lutf
71 .c.$O:
72 $(CC) $(CFLAGS) -I$(PREFIX)/include $*.c
74 %.$O: %.c
75 $(CC) $(CFLAGS) -I$(PREFIX)/include $*.c
78 $(OFILES): $(HFILES)
80 tgz:
81 rm -rf $(NAME)-$(VERSION)
82 mkdir $(NAME)-$(VERSION)
83 cp Makefile Make.* README LICENSE NOTICE *.[ch137] rpm.spec bundle.ports $(TGZFILES) $(NAME)-$(VERSION)
84 tar cf - $(NAME)-$(VERSION) | gzip >$(NAME)-$(VERSION).tgz
85 rm -rf $(NAME)-$(VERSION)
87 clean:
88 rm -f $(OFILES) $(LIB)
90 nuke:
91 rm -f $(OFILES) *.tgz *.rpm $(NUKEFILES)
93 rpm:
94 make tgz
95 cp $(NAME)-$(VERSION).tgz /usr/src/RPM/SOURCES
96 rpm -ba rpm.spec
97 cp /usr/src/RPM/SRPMS/$(NAME)-$(VERSION)-1.src.rpm .
98 cp /usr/src/RPM/RPMS/i586/$(NAME)-$(VERSION)-1.i586.rpm .
99 scp *.rpm rsc@amsterdam.lcs.mit.edu:public_html/software
101 PORTDIR=/usr/ports/$(PORTPLACE)
103 ports:
104 make tgz
105 rm -rf $(PORTDIR)
106 mkdir $(PORTDIR)
107 cp $(NAME)-$(VERSION).tgz /usr/ports/distfiles
108 cat bundle.ports | (cd $(PORTDIR) && awk '$$1=="---" && $$3=="---" { ofile=$$2; next} {if(ofile) print >ofile}')
109 (cd $(PORTDIR); make makesum)
110 (cd $(PORTDIR); make)
111 (cd $(PORTDIR); /usr/local/bin/portlint)
112 rm -rf $(PORTDIR)/work
113 shar `find $(PORTDIR)` > ports.shar
114 (cd $(PORTDIR); tar cf - *) | gzip >$(NAME)-$(VERSION)-ports.tgz
115 scp *.tgz rsc@amsterdam.lcs.mit.edu:public_html/software
117 .phony: all clean nuke install tgz rpm ports