move install to Makefile; add install for man
This commit is contained in:
7
Justfile
7
Justfile
@@ -5,10 +5,5 @@ exec *ARGS: build
|
|||||||
build/args {{ARGS}}
|
build/args {{ARGS}}
|
||||||
build:
|
build:
|
||||||
@make build
|
@make build
|
||||||
|
|
||||||
PREFIX := if shell('id -u') == "0" { '/usr/local' } else { x'$HOME/.local' }
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
install -CDm0755 -t {{ PREFIX }}/bin/ build/{{ NAME }}
|
@make install
|
||||||
# install -D -t {{ PREFIX }}/share/man/1 build/{{ NAME }}
|
|
||||||
|
|
||||||
|
|||||||
11
Makefile
11
Makefile
@@ -21,6 +21,17 @@ build: build/ build/$(NAME)
|
|||||||
build/$(NAME): src/main.c $(HEADERS)
|
build/$(NAME): src/main.c $(HEADERS)
|
||||||
cc -o $@ $<
|
cc -o $@ $<
|
||||||
|
|
||||||
|
define PREFIX
|
||||||
|
ifeq $(UID) 0
|
||||||
|
/usr/local
|
||||||
|
else
|
||||||
|
$(HOME)/.local
|
||||||
|
endif
|
||||||
|
endef
|
||||||
|
|
||||||
|
install:
|
||||||
|
install -CDm0755 -t $(PREFIX)/bin/ build/$(NAME)
|
||||||
|
install -CDm0644 -t $(PREFIX)/share/man/man1 build/$(NAME)
|
||||||
|
|
||||||
test:
|
test:
|
||||||
$(error testing using `make' not supported; use `just')
|
$(error testing using `make' not supported; use `just')
|
||||||
|
|||||||
Reference in New Issue
Block a user