xbps/prog.mk

31 lines
582 B
Makefile
Raw Normal View History

BIN_STATIC ?= $(BIN).static
OBJS ?= main.o
all: $(BIN) $(BIN_STATIC)
.PHONY: all
$(BIN_STATIC): $(OBJS)
$(CC) -static $^ $(LDFLAGS) $(STATIC_LIBS) -o $@
$(BIN): $(OBJS)
$(CC) $^ $(LDFLAGS) -o $@
.PHONY: clean
clean: clean-bins clean-objs
clean-bins:
-rm -f $(BIN) $(BIN_STATIC)
clean-objs:
-rm -f $(OBJS)
.PHONY: install
install: $(BIN) $(BIN_STATIC)
install -d $(SBINDIR)
install $(INSTALL_STRIPPED) -m 755 $(BIN) $(SBINDIR)
install $(INSTALL_STRIPPED) -m 755 $(BIN_STATIC) $(SBINDIR)
.PHONY: uninstall
uninstall:
-rm -f $(SBINDIR)/$(BIN) $(SBINDIR)/$(BIN_STATIC)