Makefile: rm BUILD target
This is the parent directory for our build system, and having it as part of the deps makes Make rebuild stuff inside of it arbitrarily, so we pull it out. We also silence git shells, to quiet down their noise when running outside of a git repo; like say in a src tar.gz
This commit is contained in:
parent
2a32700371
commit
d428ff7086
13
Makefile
13
Makefile
|
@ -13,12 +13,14 @@ CONFIGURE := $(BUILD)/.B.configure
|
|||
BUILDFLAGS := $(BUILD)/.B.buildflags
|
||||
BUILDINFO := git.st8l.com/luxolus/kdnotify/buildinfo
|
||||
|
||||
Version ?= $(shell git describe --tags --abbrev=0)
|
||||
Commit ?= $(shell git rev-parse HEAD)
|
||||
Version ?= $(shell git describe --tags --abbrev=0 2>/dev/null)
|
||||
Commit ?= $(shell git rev-parse HEAD 2>/dev/null)
|
||||
Features ?= ""
|
||||
Prefix ?= /bin
|
||||
Systemd ?= /usr/lib/systemd
|
||||
|
||||
$(shell mkdir -p $(BUILD))
|
||||
|
||||
.DEFAULT_GOAL := help
|
||||
.PHONY: help
|
||||
help:
|
||||
|
@ -89,19 +91,16 @@ $(BUILD)/$(PROJ): $(CONFIGURE) $(SRC)
|
|||
-buildmode=pie \
|
||||
-ldflags "-linkmode=external -extldflags=$$LDFLAGS $$BUILDFLAGS"
|
||||
|
||||
$(CONFIGURE): $(BUILD) $(BUILDFLAGS)
|
||||
$(CONFIGURE): $(BUILDFLAGS)
|
||||
@cat $@ >$@
|
||||
@echo "BUILDFLAGS='$$(xargs <$(BUILDFLAGS))'" >>$@
|
||||
@echo "BIN_PATH=$(Prefix)" >>$@
|
||||
@echo "SYSTEMD_PATH=$(Systemd)" >>$@
|
||||
|
||||
$(BUILDFLAGS): $(BUILD)
|
||||
$(BUILDFLAGS):
|
||||
@cat $@ >$@
|
||||
@echo '-X $(BUILDINFO).Version=$(Version)' >>$@
|
||||
@echo '-X $(BUILDINFO).CommitHash=$(Commit)' >>$@
|
||||
@echo '-X $(BUILDINFO).Features=$(Features)' >>$@
|
||||
|
||||
$(BUILD):
|
||||
@mkdir -p $@
|
||||
|
||||
# vim: ts=4 sts=4
|
||||
|
|
Loading…
Reference in a new issue