forked from FreeSpacenav/spacenavd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
44 lines (34 loc) · 892 Bytes
/
Makefile.in
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
src = $(sort $(wildcard src/*.c))
hdr = $(wildcard src/*.h)
obj = $(src:.c=.o)
dep = $(obj:.o=.d)
bin = spacenavd
ctl = spnavd_ctl
warn = -pedantic -Wall
CC ?= gcc
CFLAGS = $(warn) $(dbg) $(opt) -fno-strict-aliasing -fcommon \
-I$(srcdir)/src -I/usr/local/include -MMD $(add_cflags)
LDFLAGS = -L/usr/local/lib $(xlib) $(add_ldflags) -lm
$(bin): $(obj)
$(CC) -o $@ $(obj) $(LDFLAGS)
-include $(dep)
tags: $(src) $(hdr)
ctags $(src) $(hdr)
%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) -c $< -o $@
.PHONY: clean
clean:
rm -f $(obj) $(bin)
.PHONY: cleandep
cleandep:
rm -f $(dep)
.PHONY: install
install: $(bin)
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp $(bin) $(DESTDIR)$(PREFIX)/bin/$(bin)
cp $(srcdir)/$(ctl) $(DESTDIR)$(PREFIX)/bin/$(ctl)
cd $(srcdir) && ./setup_init --no-install
.PHONY: uninstall
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/$(bin)
rm -f $(DESTDIR)$(PREFIX)/bin/$(ctl)