2009-10-16 03:52:34 +05:30
|
|
|
BIN_STATIC ?= $(BIN).static
|
2009-08-17 22:37:20 +05:30
|
|
|
OBJS ?= main.o
|
2009-10-28 21:02:22 +05:30
|
|
|
MAN ?= $(BIN).8
|
2009-08-17 22:37:20 +05:30
|
|
|
|
2009-10-28 21:02:22 +05:30
|
|
|
all: $(BIN) $(BIN_STATIC) $(MAN)
|
2009-08-17 22:37:20 +05:30
|
|
|
.PHONY: all
|
|
|
|
|
2009-10-28 21:02:22 +05:30
|
|
|
$(MAN):
|
|
|
|
a2x -f manpage $(MAN).txt
|
|
|
|
|
2009-10-16 03:52:34 +05:30
|
|
|
$(BIN_STATIC): $(OBJS)
|
|
|
|
$(CC) -static $^ $(LDFLAGS) $(STATIC_LIBS) -o $@
|
|
|
|
|
2009-08-17 22:37:20 +05:30
|
|
|
$(BIN): $(OBJS)
|
2009-10-16 03:52:34 +05:30
|
|
|
$(CC) $^ $(LDFLAGS) -o $@
|
2009-08-17 22:37:20 +05:30
|
|
|
|
|
|
|
.PHONY: clean
|
2009-10-28 21:02:22 +05:30
|
|
|
clean:
|
|
|
|
-rm -f $(BIN) $(BIN_STATIC) $(MAN)
|
2009-08-17 22:37:20 +05:30
|
|
|
-rm -f $(OBJS)
|
|
|
|
|
2009-08-21 14:47:58 +05:30
|
|
|
.PHONY: install
|
2009-10-28 21:02:22 +05:30
|
|
|
install: $(BIN) $(BIN_STATIC) $(MAN)
|
2009-08-17 22:37:20 +05:30
|
|
|
install -d $(SBINDIR)
|
|
|
|
install $(INSTALL_STRIPPED) -m 755 $(BIN) $(SBINDIR)
|
2009-10-16 03:52:34 +05:30
|
|
|
install $(INSTALL_STRIPPED) -m 755 $(BIN_STATIC) $(SBINDIR)
|
2009-10-30 07:43:03 +05:30
|
|
|
ifdef MAN
|
|
|
|
install -d $(MANDIR)
|
2009-10-28 21:02:22 +05:30
|
|
|
install -m 644 $(MAN) $(MANDIR)
|
2009-10-30 07:43:03 +05:30
|
|
|
endif
|
2009-10-18 21:09:32 +05:30
|
|
|
|
|
|
|
.PHONY: uninstall
|
|
|
|
uninstall:
|
|
|
|
-rm -f $(SBINDIR)/$(BIN) $(SBINDIR)/$(BIN_STATIC)
|