kopia lustrzana https://github.com/FreeSpacenav/spacenavd
45 wiersze
892 B
Makefile
45 wiersze
892 B
Makefile
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)
|