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)
|
2015-05-16 13:15:35 +05:30
|
|
|
MANSECTION ?= 1
|
2015-04-16 13:58:01 +05:30
|
|
|
MAN ?= $(BIN).$(MANSECTION)
|
2012-07-19 19:31:12 +05:30
|
|
|
|
|
|
|
ifdef BUILD_STATIC
|
|
|
|
BINS += $(BIN).static
|
|
|
|
endif
|
|
|
|
|
2014-04-06 15:51:24 +05:30
|
|
|
CFLAGS+= -Wno-unused-result
|
|
|
|
|
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
|
2012-11-03 14:12:51 +05:30
|
|
|
-rm -f *.o
|
2009-08-17 22:37:20 +05:30
|
|
|
|
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)
|
2013-08-29 18:05:08 +05:30
|
|
|
install -m 755 $(BIN) $(DESTDIR)$(SBINDIR)
|
2012-07-19 19:31:12 +05:30
|
|
|
ifdef BUILD_STATIC
|
2013-08-29 18:05:08 +05:30
|
|
|
install -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
|
2015-04-16 13:58:01 +05:30
|
|
|
install -d $(DESTDIR)$(MANDIR)/man$(MANSECTION)
|
|
|
|
install -m 644 $(MAN) $(DESTDIR)$(MANDIR)/man$(MANSECTION)
|
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
|
2015-04-16 13:58:01 +05:30
|
|
|
-rm -f $(DESTDIR)$(MANDIR)/man$(MANSECTION)/$(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"
|
2013-10-05 15:08:04 +05:30
|
|
|
${SILENT}$(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -c $<
|
2009-11-21 02:32:32 +05:30
|
|
|
|
2019-03-22 20:14:15 +05:30
|
|
|
$(BIN).static: $(OBJS) $(STATIC_LIBS)
|
2010-01-24 18:29:58 +05:30
|
|
|
@printf " [CCLD]\t\t$@\n"
|
2019-03-22 20:14:15 +05:30
|
|
|
${SILENT}$(CC) -static $(OBJS) $(CPPFLAGS) -L$(TOPDIR)/lib \
|
2011-01-23 19:11:07 +05:30
|
|
|
$(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"
|
2012-09-04 15:08:21 +05:30
|
|
|
${SILENT}$(CC) $^ $(CPPFLAGS) -L$(TOPDIR)/lib \
|
|
|
|
$(CFLAGS) $(PROG_CFLAGS) $(LDFLAGS) $(PROG_LDFLAGS) \
|
|
|
|
-lxbps -o $@
|
2009-11-21 02:32:32 +05:30
|
|
|
|