2010-05-20 02:08:27 +05:30
|
|
|
-include $(TOPDIR)/config.mk
|
|
|
|
|
2009-11-19 10:33:37 +05:30
|
|
|
OBJS ?= main.o
|
2009-08-17 22:37:20 +05:30
|
|
|
|
2012-07-19 19:31:12 +05:30
|
|
|
BINS = $(BIN)
|
|
|
|
|
|
|
|
ifdef BUILD_STATIC
|
|
|
|
BINS += $(BIN).static
|
|
|
|
endif
|
|
|
|
|
2009-11-19 10:33:37 +05:30
|
|
|
.PHONY: all
|
2012-07-19 19:31:12 +05:30
|
|
|
all: $(BINS)
|
2009-08-17 22:37:20 +05:30
|
|
|
|
|
|
|
.PHONY: clean
|
2009-10-28 21:02:22 +05:30
|
|
|
clean:
|
2010-05-04 01:20:34 +05:30
|
|
|
-rm -f $(BIN) $(BIN).static
|
2009-08-17 22:37:20 +05:30
|
|
|
-rm -f $(OBJS)
|
|
|
|
|
2009-08-21 14:47:58 +05:30
|
|
|
.PHONY: install
|
2009-10-30 22:02:09 +05:30
|
|
|
install: all
|
2010-01-24 18:29:58 +05:30
|
|
|
install -d $(DESTDIR)$(SBINDIR)
|
|
|
|
install $(INSTALL_STRIPPED) -m 755 $(BIN) $(DESTDIR)$(SBINDIR)
|
2012-07-19 19:31:12 +05:30
|
|
|
ifdef BUILD_STATIC
|
2010-01-24 18:29:58 +05:30
|
|
|
install $(INSTALL_STRIPPED) -m 755 $(BIN).static $(DESTDIR)$(SBINDIR)
|
2012-07-19 19:31:12 +05:30
|
|
|
endif
|
2009-10-30 07:43:03 +05:30
|
|
|
ifdef MAN
|
2010-01-24 18:29:58 +05:30
|
|
|
install -d $(DESTDIR)$(MANDIR)/man8
|
|
|
|
install -m 644 $(MAN) $(DESTDIR)$(MANDIR)/man8
|
2009-10-30 07:43:03 +05:30
|
|
|
endif
|
2009-10-18 21:09:32 +05:30
|
|
|
|
|
|
|
.PHONY: uninstall
|
|
|
|
uninstall:
|
2010-01-24 18:29:58 +05:30
|
|
|
-rm -f $(DESTDIR)$(SBINDIR)/$(BIN)
|
2012-07-19 19:31:12 +05:30
|
|
|
ifdef BUILD_STATIC
|
2010-01-24 18:29:58 +05:30
|
|
|
-rm -f $(DESTDIR)$(SBINDIR)/$(BIN).static
|
2012-07-19 19:31:12 +05:30
|
|
|
endif
|
2009-11-19 10:33:37 +05:30
|
|
|
ifdef MAN
|
2010-01-24 18:29:58 +05:30
|
|
|
-rm -f $(DESTDIR)$(MANDIR)/man8/$(MAN)
|
2009-11-19 10:33:37 +05:30
|
|
|
endif
|
2009-11-21 02:32:32 +05:30
|
|
|
|
|
|
|
%.o: %.c
|
2010-01-24 18:29:58 +05:30
|
|
|
@printf " [CC]\t\t$@\n"
|
2011-01-15 15:19:35 +05:30
|
|
|
${SILENT}$(CC) $(CPPFLAGS) $(CFLAGS) -c $<
|
2009-11-21 02:32:32 +05:30
|
|
|
|
|
|
|
$(BIN).static: $(OBJS)
|
2010-01-24 18:29:58 +05:30
|
|
|
@printf " [CCLD]\t\t$@\n"
|
2011-01-23 19:11:07 +05:30
|
|
|
${SILENT}$(CC) -static $^ $(CPPFLAGS) -L$(TOPDIR)/lib \
|
|
|
|
$(CFLAGS) $(LDFLAGS) $(STATIC_LIBS) -o $@
|
2009-11-21 02:32:32 +05:30
|
|
|
|
|
|
|
$(BIN): $(OBJS)
|
2010-01-24 18:29:58 +05:30
|
|
|
@printf " [CCLD]\t\t$@\n"
|
2011-01-23 19:11:07 +05:30
|
|
|
${SILENT}$(CC) $^ $(CPPFLAGS) -L$(TOPDIR)/lib $(CFLAGS) \
|
2012-07-19 20:00:53 +05:30
|
|
|
$(PROG_CFLAGS) $(LDFLAGS) -lxbps -o $@
|
2009-11-21 02:32:32 +05:30
|
|
|
|