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 LIB=libdraw.a
22 VERSION=2.0
23 PORTPLACE=devel/libdraw
24 NAME=libdraw
26 # keyboard.$O\
27 # newwindow.$O\
28 OFILES=\
29 alloc.$O\
30 allocimagemix.$O\
31 arith.$O\
32 bezier.$O\
33 border.$O\
34 buildfont.$O\
35 bytesperline.$O\
36 chan.$O\
37 cloadimage.$O\
38 computil.$O\
39 creadimage.$O\
40 debug.$O\
41 defont.$O\
42 draw.$O\
43 drawrepl.$O\
44 egetrect.$O\
45 ellipse.$O\
46 emenuhit.$O\
47 font.$O\
48 freesubfont.$O\
49 getdefont.$O\
50 getrect.$O\
51 getsubfont.$O\
52 icossin.$O\
53 icossin2.$O\
54 init.$O\
55 line.$O\
56 loadimage.$O\
57 menuhit.$O\
58 mkfont.$O\
59 openfont.$O\
60 poly.$O\
61 readcolmap.$O\
62 readimage.$O\
63 readsubfont.$O\
64 rectclip.$O\
65 replclipr.$O\
66 rgb.$O\
67 string.$O\
68 stringbg.$O\
69 stringsubfont.$O\
70 stringwidth.$O\
71 subfont.$O\
72 subfontcache.$O\
73 subfontname.$O\
74 unloadimage.$O\
75 window.$O\
76 writecolmap.$O\
77 writeimage.$O\
78 writesubfont.$O\
79 md-alloc.$O\
80 md-arc.$O\
81 md-cload.$O\
82 md-cmap.$O\
83 md-cread.$O\
84 md-defont.$O\
85 md-draw.$O\
86 md-ellipse.$O\
87 md-fillpoly.$O\
88 md-hwdraw.$O\
89 md-iprint.$O\
90 md-line.$O\
91 md-load.$O\
92 md-openmemsubfont.$O\
93 md-poly.$O\
94 md-read.$O\
95 md-string.$O\
96 md-subfont.$O\
97 md-unload.$O\
98 md-write.$O\
99 ml-draw.$O\
100 ml-lalloc.$O\
101 ml-layerop.$O\
102 ml-ldelete.$O\
103 ml-lhide.$O\
104 ml-line.$O\
105 ml-load.$O\
106 ml-lorigin.$O\
107 ml-lsetrefresh.$O\
108 ml-ltofront.$O\
109 ml-ltorear.$O\
110 ml-unload.$O\
111 x11-alloc.$O\
112 x11-cload.$O\
113 x11-draw.$O\
114 x11-event.$O\
115 x11-fill.$O\
116 x11-get.$O\
117 x11-init.$O\
118 x11-itrans.$O\
119 x11-keyboard.$O\
120 x11-load.$O\
121 x11-mouse.$O\
122 x11-pixelbits.$O\
123 x11-unload.$O\
124 devdraw.$O\
125 unix.$O\
127 HFILES=\
128 draw.h\
129 memdraw.h
131 all: $(LIB)
133 install: $(LIB)
134 install -c -m 0644 $(LIB) $(PREFIX)/lib/$(LIB)
135 install -c -m 0644 draw.h $(PREFIX)/include/draw.h
136 install -c -m 0644 event.h $(PREFIX)/include/event.h
137 install -c -m 0644 cursor.h $(PREFIX)/include/cursor.h
138 install -c -m 0644 mouse.h $(PREFIX)/include/mouse.h
139 install -c -m 0644 keyboard.h $(PREFIX)/include/keyboard.h
141 test: test.o $(LIB)
142 gcc -o test test.o $(LIB) -L$(PREFIX)/lib -l9 -lfmt -lutf -L/usr/X11R6/lib -lX11 -lm
144 $(LIB): $(OFILES)
145 $(AR) $(ARFLAGS) $(LIB) $(OFILES)
147 NUKEFILES+=$(LIB)
148 .c.$O:
149 $(CC) $(CFLAGS) -I/usr/X11R6/include -I../sam -I$(PREFIX)/include $*.c
151 %.$O: %.c
152 $(CC) $(CFLAGS) -I/usr/X11R6/include -I../sam -I$(PREFIX)/include $*.c
155 $(OFILES): $(HFILES)
157 tgz:
158 rm -rf $(NAME)-$(VERSION)
159 mkdir $(NAME)-$(VERSION)
160 cp Makefile Make.* README LICENSE NOTICE *.[ch137] rpm.spec bundle.ports $(TGZFILES) $(NAME)-$(VERSION)
161 tar cf - $(NAME)-$(VERSION) | gzip >$(NAME)-$(VERSION).tgz
162 rm -rf $(NAME)-$(VERSION)
164 clean:
165 rm -f $(OFILES) $(LIB)
167 nuke:
168 rm -f $(OFILES) *.tgz *.rpm $(NUKEFILES)
170 rpm:
171 make tgz
172 cp $(NAME)-$(VERSION).tgz /usr/src/RPM/SOURCES
173 rpm -ba rpm.spec
174 cp /usr/src/RPM/SRPMS/$(NAME)-$(VERSION)-1.src.rpm .
175 cp /usr/src/RPM/RPMS/i586/$(NAME)-$(VERSION)-1.i586.rpm .
176 scp *.rpm rsc@amsterdam.lcs.mit.edu:public_html/software
178 PORTDIR=/usr/ports/$(PORTPLACE)
180 ports:
181 make tgz
182 rm -rf $(PORTDIR)
183 mkdir $(PORTDIR)
184 cp $(NAME)-$(VERSION).tgz /usr/ports/distfiles
185 cat bundle.ports | (cd $(PORTDIR) && awk '$$1=="---" && $$3=="---" { ofile=$$2; next} {if(ofile) print >ofile}')
186 (cd $(PORTDIR); make makesum)
187 (cd $(PORTDIR); make)
188 (cd $(PORTDIR); /usr/local/bin/portlint)
189 rm -rf $(PORTDIR)/work
190 shar `find $(PORTDIR)` > ports.shar
191 (cd $(PORTDIR); tar cf - *) | gzip >$(NAME)-$(VERSION)-ports.tgz
192 scp *.tgz rsc@amsterdam.lcs.mit.edu:public_html/software
194 .phony: all clean nuke install tgz rpm ports