xbps/mk/test.mk
Juan RP 2e469aaabf configure: added --enable-rpath option.
If set, binaries will have rpath set to $ORIGIN/../lib. That means
that even using defaults (--prefix=/usr), you can install
it via DESTDIR anywhere in your system and binaries will work.

This is in preparation for BSD support.

Closes: #87 [via git-merge-pr]
2019-04-26 16:27:41 +02:00

41 lines
895 B
Makefile

-include $(TOPDIR)/config.mk
OBJS ?= main.o
.PHONY: all
all: $(TEST) $(TESTSHELL)
.PHONY: clean
clean:
-rm -f $(TEST) $(TESTSHELL) $(OBJS)
.PHONY: install
install:
install -d $(DESTDIR)$(TESTSDIR)/$(TESTSSUBDIR)
ifdef TEST
install -m755 $(TEST) $(DESTDIR)$(TESTSDIR)/$(TESTSSUBDIR)
endif
ifdef TESTSHELL
install -m755 $(TESTSHELL) $(DESTDIR)$(TESTSDIR)/$(TESTSSUBDIR)
endif
ifdef EXTRA_FILES
for f in $(EXTRA_FILES); do \
install -m644 $${f} $(DESTDIR)$(TESTSDIR)/$(TESTSSUBDIR); \
done
endif
.PHONY: uninstall
uninstall:
-rm -f $(DESTDIR)$(TESTSDIR)/$(TESTSSUBDIR)/$(TEST)
-rm -f $(DESTDIR)$(TESTSDIR)/$(TESTSSUBDIR)/$(TESTSHELL)
%.o: %.c
@printf " [CC]\t\t$@\n"
${SILENT}$(CC) $(CPPFLAGS) $(CFLAGS) -c $<
$(TEST): $(OBJS)
@printf " [CCLD]\t\t$@\n"
${SILENT}$(CC) $^ $(CPPFLAGS) -L$(TOPDIR)/lib $(CFLAGS) \
$(PROG_CFLAGS) $(LDFLAGS) $(PROG_LDFLAGS) -lxbps -latf-c -o $@