aboutsummaryrefslogtreecommitdiff
path: root/src/libdraw/Makefile
blob: 0aa2cd2dd6379be55e50c439b185e306e5925a78 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194

# this works in gnu make
SYSNAME:=${shell uname}
OBJTYPE:=${shell uname -m | sed 's;i.86;386;; s;/.*;;; s; ;;g'}

# this works in bsd make
SYSNAME!=uname
OBJTYPE!=uname -m | sed 's;i.86;386;; s;/.*;;; s; ;;g'

# the gnu rules will mess up bsd but not vice versa,
# hence the gnu rules come first.

include Make.$(SYSNAME)-$(OBJTYPE)

PREFIX=/usr/local

NUKEFILES=

TGZFILES=

LIB=libdraw.a
VERSION=2.0
PORTPLACE=devel/libdraw
NAME=libdraw

# keyboard.$O\
# newwindow.$O\
OFILES=\
	alloc.$O\
	allocimagemix.$O\
	arith.$O\
	bezier.$O\
	border.$O\
	buildfont.$O\
	bytesperline.$O\
	chan.$O\
	cloadimage.$O\
	computil.$O\
	creadimage.$O\
	debug.$O\
	defont.$O\
	draw.$O\
	drawrepl.$O\
	egetrect.$O\
	ellipse.$O\
	emenuhit.$O\
	font.$O\
	freesubfont.$O\
	getdefont.$O\
	getrect.$O\
	getsubfont.$O\
	icossin.$O\
	icossin2.$O\
	init.$O\
	line.$O\
	loadimage.$O\
	menuhit.$O\
	mkfont.$O\
	openfont.$O\
	poly.$O\
	readcolmap.$O\
	readimage.$O\
	readsubfont.$O\
	rectclip.$O\
	replclipr.$O\
	rgb.$O\
	string.$O\
	stringbg.$O\
	stringsubfont.$O\
	stringwidth.$O\
	subfont.$O\
	subfontcache.$O\
	subfontname.$O\
	unloadimage.$O\
	window.$O\
	writecolmap.$O\
	writeimage.$O\
	writesubfont.$O\
	md-alloc.$O\
	md-arc.$O\
	md-cload.$O\
	md-cmap.$O\
	md-cread.$O\
	md-defont.$O\
	md-draw.$O\
	md-ellipse.$O\
	md-fillpoly.$O\
	md-hwdraw.$O\
	md-iprint.$O\
	md-line.$O\
	md-load.$O\
	md-openmemsubfont.$O\
	md-poly.$O\
	md-read.$O\
	md-string.$O\
	md-subfont.$O\
	md-unload.$O\
	md-write.$O\
	ml-draw.$O\
	ml-lalloc.$O\
	ml-layerop.$O\
	ml-ldelete.$O\
	ml-lhide.$O\
	ml-line.$O\
	ml-load.$O\
	ml-lorigin.$O\
	ml-lsetrefresh.$O\
	ml-ltofront.$O\
	ml-ltorear.$O\
	ml-unload.$O\
	x11-alloc.$O\
	x11-cload.$O\
	x11-draw.$O\
	x11-event.$O\
	x11-fill.$O\
	x11-get.$O\
	x11-init.$O\
	x11-itrans.$O\
	x11-keyboard.$O\
	x11-load.$O\
	x11-mouse.$O\
	x11-pixelbits.$O\
	x11-unload.$O\
	devdraw.$O\
	unix.$O\

HFILES=\
	draw.h\
	memdraw.h

all: $(LIB)

install: $(LIB)
	install -c -m 0644 $(LIB) $(PREFIX)/lib/$(LIB)
	install -c -m 0644 draw.h $(PREFIX)/include/draw.h
	install -c -m 0644 event.h $(PREFIX)/include/event.h
	install -c -m 0644 cursor.h $(PREFIX)/include/cursor.h
	install -c -m 0644 mouse.h $(PREFIX)/include/mouse.h
	install -c -m 0644 keyboard.h $(PREFIX)/include/keyboard.h

test: test.o $(LIB)
	gcc -o test test.o $(LIB) -L$(PREFIX)/lib -l9 -lfmt -lutf -L/usr/X11R6/lib -lX11 -lm

$(LIB): $(OFILES)
	$(AR) $(ARFLAGS) $(LIB) $(OFILES)

NUKEFILES+=$(LIB)
.c.$O:
	$(CC) $(CFLAGS) -I/usr/X11R6/include -I../sam -I$(PREFIX)/include $*.c

%.$O: %.c
	$(CC) $(CFLAGS) -I/usr/X11R6/include -I../sam -I$(PREFIX)/include $*.c


$(OFILES): $(HFILES)

tgz:
	rm -rf $(NAME)-$(VERSION)
	mkdir $(NAME)-$(VERSION)
	cp Makefile Make.* README LICENSE NOTICE *.[ch137] rpm.spec bundle.ports $(TGZFILES) $(NAME)-$(VERSION)
	tar cf - $(NAME)-$(VERSION) | gzip >$(NAME)-$(VERSION).tgz
	rm -rf $(NAME)-$(VERSION)

clean:
	rm -f $(OFILES) $(LIB)

nuke:
	rm -f $(OFILES) *.tgz *.rpm $(NUKEFILES)

rpm:
	make tgz
	cp $(NAME)-$(VERSION).tgz /usr/src/RPM/SOURCES
	rpm -ba rpm.spec
	cp /usr/src/RPM/SRPMS/$(NAME)-$(VERSION)-1.src.rpm .
	cp /usr/src/RPM/RPMS/i586/$(NAME)-$(VERSION)-1.i586.rpm .
	scp *.rpm rsc@amsterdam.lcs.mit.edu:public_html/software

PORTDIR=/usr/ports/$(PORTPLACE)

ports:
	make tgz
	rm -rf $(PORTDIR)
	mkdir $(PORTDIR)
	cp $(NAME)-$(VERSION).tgz /usr/ports/distfiles
	cat bundle.ports | (cd $(PORTDIR) && awk '$$1=="---" && $$3=="---" { ofile=$$2; next} {if(ofile) print >ofile}')
	(cd $(PORTDIR); make makesum)
	(cd $(PORTDIR); make)
	(cd $(PORTDIR); /usr/local/bin/portlint)
	rm -rf $(PORTDIR)/work
	shar `find $(PORTDIR)` > ports.shar
	(cd $(PORTDIR); tar cf - *) | gzip >$(NAME)-$(VERSION)-ports.tgz
	scp *.tgz rsc@amsterdam.lcs.mit.edu:public_html/software

.phony: all clean nuke install tgz rpm ports