2e469aaabf
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]
41 lines
895 B
Makefile
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 $@
|
|
|