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
|
|
|
|
2009-11-19 06:03:37 +01:00
|
|
|
.PHONY: all
|
2010-05-03 21:50:34 +02:00
|
|
|
all: $(BIN) $(BIN).static
|
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
|
2009-08-17 19:07:20 +02:00
|
|
|
-rm -f $(OBJS)
|
|
|
|
|
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)
|
|
|
|
install $(INSTALL_STRIPPED) -m 755 $(BIN) $(DESTDIR)$(SBINDIR)
|
|
|
|
install $(INSTALL_STRIPPED) -m 755 $(BIN).static $(DESTDIR)$(SBINDIR)
|
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)
|
|
|
|
-rm -f $(DESTDIR)$(SBINDIR)/$(BIN).static
|
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"
|
2011-01-15 10:49:35 +01:00
|
|
|
${SILENT}$(CC) $(CPPFLAGS) $(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"
|
2011-01-23 14:41:07 +01:00
|
|
|
${SILENT}$(CC) $^ $(CPPFLAGS) -L$(TOPDIR)/lib $(CFLAGS) \
|
|
|
|
$(PROG_CFLAGS) $(LDFLAGS) $(PROG_LDFLAGS) -o $@
|
2009-11-20 22:02:32 +01:00
|
|
|
|