2010-05-19 22:38:27 +02:00
|
|
|
-include $(TOPDIR)/config.mk
|
|
|
|
|
2009-11-19 06:03:37 +01:00
|
|
|
OBJS ?= main.o
|
2009-08-17 19:07:20 +02:00
|
|
|
|
2012-07-19 16:01:12 +02:00
|
|
|
BINS = $(BIN)
|
2013-09-16 08:57:24 +02:00
|
|
|
MAN ?= $(BIN).8
|
2012-07-19 16:01:12 +02:00
|
|
|
|
|
|
|
ifdef BUILD_STATIC
|
|
|
|
BINS += $(BIN).static
|
|
|
|
endif
|
|
|
|
|
2014-04-06 12:21:24 +02:00
|
|
|
CFLAGS+= -Wno-unused-result
|
|
|
|
|
2009-11-19 06:03:37 +01:00
|
|
|
.PHONY: all
|
2012-07-19 16:01:12 +02:00
|
|
|
all: $(BINS)
|
2009-08-17 19:07:20 +02:00
|
|
|
|
|
|
|
.PHONY: clean
|
2009-10-28 16:32:22 +01:00
|
|
|
clean:
|
2010-05-03 21:50:34 +02:00
|
|
|
-rm -f $(BIN) $(BIN).static
|
2012-11-03 09:42:51 +01:00
|
|
|
-rm -f *.o
|
2009-08-17 19:07:20 +02:00
|
|
|
|
2009-08-21 11:17:58 +02:00
|
|
|
.PHONY: install
|
2009-10-30 17:32:09 +01:00
|
|
|
install: all
|
2010-01-24 13:59:58 +01:00
|
|
|
install -d $(DESTDIR)$(SBINDIR)
|
2013-08-29 14:35:08 +02:00
|
|
|
install -m 755 $(BIN) $(DESTDIR)$(SBINDIR)
|
2012-07-19 16:01:12 +02:00
|
|
|
ifdef BUILD_STATIC
|
2013-08-29 14:35:08 +02:00
|
|
|
install -m 755 $(BIN).static $(DESTDIR)$(SBINDIR)
|
2012-07-19 16:01:12 +02:00
|
|
|
endif
|
2009-10-30 03:13:03 +01:00
|
|
|
ifdef MAN
|
2010-01-24 13:59:58 +01:00
|
|
|
install -d $(DESTDIR)$(MANDIR)/man8
|
|
|
|
install -m 644 $(MAN) $(DESTDIR)$(MANDIR)/man8
|
2009-10-30 03:13:03 +01:00
|
|
|
endif
|
2009-10-18 17:39:32 +02:00
|
|
|
|
|
|
|
.PHONY: uninstall
|
|
|
|
uninstall:
|
2010-01-24 13:59:58 +01:00
|
|
|
-rm -f $(DESTDIR)$(SBINDIR)/$(BIN)
|
2012-07-19 16:01:12 +02:00
|
|
|
ifdef BUILD_STATIC
|
2010-01-24 13:59:58 +01:00
|
|
|
-rm -f $(DESTDIR)$(SBINDIR)/$(BIN).static
|
2012-07-19 16:01:12 +02:00
|
|
|
endif
|
2009-11-19 06:03:37 +01:00
|
|
|
ifdef MAN
|
2010-01-24 13:59:58 +01:00
|
|
|
-rm -f $(DESTDIR)$(MANDIR)/man8/$(MAN)
|
2009-11-19 06:03:37 +01:00
|
|
|
endif
|
2009-11-20 22:02:32 +01:00
|
|
|
|
|
|
|
%.o: %.c
|
2010-01-24 13:59:58 +01:00
|
|
|
@printf " [CC]\t\t$@\n"
|
2013-10-05 11:38:04 +02:00
|
|
|
${SILENT}$(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -c $<
|
2009-11-20 22:02:32 +01:00
|
|
|
|
|
|
|
$(BIN).static: $(OBJS)
|
2010-01-24 13:59:58 +01:00
|
|
|
@printf " [CCLD]\t\t$@\n"
|
2011-01-23 14:41:07 +01:00
|
|
|
${SILENT}$(CC) -static $^ $(CPPFLAGS) -L$(TOPDIR)/lib \
|
|
|
|
$(CFLAGS) $(LDFLAGS) $(STATIC_LIBS) -o $@
|
2009-11-20 22:02:32 +01:00
|
|
|
|
|
|
|
$(BIN): $(OBJS)
|
2010-01-24 13:59:58 +01:00
|
|
|
@printf " [CCLD]\t\t$@\n"
|
2012-09-04 11:38:21 +02:00
|
|
|
${SILENT}$(CC) $^ $(CPPFLAGS) -L$(TOPDIR)/lib \
|
|
|
|
$(CFLAGS) $(PROG_CFLAGS) $(LDFLAGS) $(PROG_LDFLAGS) \
|
|
|
|
-lxbps -o $@
|
2009-11-20 22:02:32 +01:00
|
|
|
|