-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (28 loc) · 775 Bytes
/
Makefile
File metadata and controls
38 lines (28 loc) · 775 Bytes
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
PREFIX = /usr/local
olib = miniglut.o
alib = libminiglut.a
tests = 3dview vsync
CFLAGS = -O3 -g3
LDFLAGS = -lGL -lX11 -lm
.PHONY: all
all: $(alib) $(tests)
3dview: tests/3dview.o $(alib)
$(CC) -o $@ tests/3dview.o $(alib) $(LDFLAGS)
vsync: tests/vsync.o $(alib)
$(CC) -o $@ tests/vsync.o $(alib) $(LDFLAGS)
$(alib): $(olib)
$(AR) rcs $@ $(olib)
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
.PHONY: clean
clean:
rm -f $(alib) $(olib) $(tests) tests/*.o
.PHONY: install
install: $(alib)
mkdir -p $(DESTDIR)$(PREFIX)/include $(DESTDIR)$(PREFIX)/lib
cp miniglut.h $(DESTDIR)$(PREFIX)/include/miniglut.h
cp $(alib) $(DESTDIR)$(PREFIX)/lib/libminiglut.a
.PHONY: uninstall
uninstall:
rm -f $(DESTDIR)$(PREFIX)/include/miniglut.h
rm -f $(DESTDIR)$(PREFIX)/lib/libminiglut.a