2017-05-27 06:50:36 +00:00
|
|
|
src = $(sort $(wildcard src/*.c) $(wildcard src/serial/*.c) $(wildcard src/magellan/*.c))
|
2012-10-27 18:50:11 +00:00
|
|
|
hdr = $(wildcard src/*.h) $(wildcard src/serial/*.h) $(wildcard src/magellan/*.h)
|
2009-07-20 22:47:08 +00:00
|
|
|
obj = $(src:.c=.o)
|
2011-11-05 20:23:24 +00:00
|
|
|
dep = $(obj:.o=.d)
|
2008-04-09 07:25:15 +00:00
|
|
|
bin = spacenavd
|
|
|
|
ctl = spnavd_ctl
|
|
|
|
|
|
|
|
CC = gcc
|
|
|
|
INSTALL = install
|
2020-01-31 23:19:14 +00:00
|
|
|
CFLAGS = -pedantic -Wall $(dbg) $(opt) -fno-strict-aliasing -fcommon \
|
|
|
|
-I$(srcdir)/src -I/usr/local/include $(add_cflags)
|
2012-05-17 03:56:12 +00:00
|
|
|
LDFLAGS = -L/usr/local/lib $(xlib) $(add_ldflags)
|
2008-04-09 07:25:15 +00:00
|
|
|
|
|
|
|
$(bin): $(obj)
|
2008-08-14 02:10:34 +00:00
|
|
|
$(CC) -o $@ $(obj) $(LDFLAGS)
|
|
|
|
|
2011-11-05 20:23:24 +00:00
|
|
|
-include $(dep)
|
|
|
|
|
2010-06-07 00:47:02 +00:00
|
|
|
tags: $(src) $(hdr)
|
|
|
|
ctags $(src) $(hdr)
|
|
|
|
|
2008-08-14 02:10:34 +00:00
|
|
|
%.o: $(srcdir)/%.c
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
2008-04-09 07:25:15 +00:00
|
|
|
|
2011-11-05 20:23:24 +00:00
|
|
|
%.d: $(srcdir)/%.c
|
|
|
|
@$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
|
|
|
|
|
2008-04-09 07:25:15 +00:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -f $(obj) $(bin)
|
|
|
|
|
2013-06-26 00:12:28 +00:00
|
|
|
.PHONY: cleandep
|
|
|
|
cleandep:
|
|
|
|
rm -f $(dep)
|
|
|
|
|
2008-04-09 07:25:15 +00:00
|
|
|
.PHONY: install
|
|
|
|
install: $(bin)
|
2012-05-10 19:39:47 +00:00
|
|
|
$(INSTALL) -d $(DESTDIR)$(PREFIX)/bin
|
|
|
|
$(INSTALL) -m 755 $(bin) $(DESTDIR)$(PREFIX)/bin/$(bin)
|
|
|
|
$(INSTALL) -m 755 $(srcdir)/$(ctl) $(DESTDIR)$(PREFIX)/bin/$(ctl)
|
2008-08-14 02:10:34 +00:00
|
|
|
cd $(srcdir) && ./setup_init --no-install
|
2008-04-09 07:25:15 +00:00
|
|
|
|
2009-07-24 01:04:12 +00:00
|
|
|
# [ -d /etc/hal/fdi/policy ] && \
|
2012-05-10 19:39:47 +00:00
|
|
|
# $(INSTALL) -m 644 spacenav.fdi $(DESTDIR)/etc/hal/fdi/policy/spacenav.fdi
|
2009-07-24 01:04:12 +00:00
|
|
|
|
2008-04-09 07:25:15 +00:00
|
|
|
.PHONY: uninstall
|
|
|
|
uninstall:
|
2012-05-10 19:39:47 +00:00
|
|
|
rm -f $(DESTDIR)$(PREFIX)/bin/$(bin)
|
|
|
|
rm -f $(DESTDIR)$(PREFIX)/bin/$(ctl)
|
|
|
|
rm -f $(DESTDIR)/etc/hal/fdi/policy/spacenav.fdi
|
2009-07-24 01:04:12 +00:00
|
|
|
|
2008-08-14 02:10:34 +00:00
|
|
|
# cd $(srcdir) && ./setup_init remove
|