2009-11-19 10:33:37 +05:30
|
|
|
OBJS ?= main.o
|
2010-01-06 15:45:56 +05:30
|
|
|
CFLAGS += -fPIE
|
2009-12-28 20:49:58 +05:30
|
|
|
LDFLAGS += -lxbps
|
2009-08-17 22:37:20 +05:30
|
|
|
|
2009-11-19 10:33:37 +05:30
|
|
|
.PHONY: all
|
|
|
|
all: $(BIN) $(BIN).static $(MAN)
|
2009-08-17 22:37:20 +05:30
|
|
|
|
|
|
|
.PHONY: clean
|
2009-10-28 21:02:22 +05:30
|
|
|
clean:
|
2009-10-30 16:47:26 +05:30
|
|
|
-rm -f $(BIN) $(MAN)
|
|
|
|
-rm -f $(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
|
2009-08-17 22:37:20 +05:30
|
|
|
install -d $(SBINDIR)
|
|
|
|
install $(INSTALL_STRIPPED) -m 755 $(BIN) $(SBINDIR)
|
2009-10-30 16:47:26 +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:
|
2009-10-30 16:47:26 +05:30
|
|
|
-rm -f $(SBINDIR)/$(BIN)
|
|
|
|
-rm -f $(SBINDIR)/$(BIN).static
|
2009-11-19 10:33:37 +05:30
|
|
|
|
|
|
|
ifdef MAN
|
|
|
|
-rm -f $(MANDIR)/$(MAN)
|
|
|
|
endif
|
2009-11-21 02:32:32 +05:30
|
|
|
|
|
|
|
%.o: %.c
|
2010-01-19 01:48:26 +05:30
|
|
|
@echo " [CC]\t\t$@"
|
2009-12-28 20:49:58 +05:30
|
|
|
@$(CC) $(CPPFLAGS) $(CFLAGS) -c $<
|
2009-11-21 02:32:32 +05:30
|
|
|
|
|
|
|
$(MAN):
|
2010-01-19 01:48:26 +05:30
|
|
|
@echo " [ASCIIDOC]\t$(MAN)"
|
2009-11-21 02:32:32 +05:30
|
|
|
@a2x -f manpage $(MAN).txt
|
|
|
|
|
|
|
|
$(BIN).static: $(OBJS)
|
2010-01-19 01:48:26 +05:30
|
|
|
@echo " [CCLD]\t\t$@"
|
2009-11-21 02:32:32 +05:30
|
|
|
@$(CC) -static $^ $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) \
|
|
|
|
$(STATIC_LIBS) -o $@ >/dev/null 2>&1
|
|
|
|
|
|
|
|
$(BIN): $(OBJS)
|
2010-01-19 01:48:26 +05:30
|
|
|
@echo " [CCLD]\t\t$@"
|
2010-01-06 15:45:56 +05:30
|
|
|
@$(CC) $^ $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -pie -o $@
|
2009-11-21 02:32:32 +05:30
|
|
|
|