-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (49 loc) · 1.17 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
BUILD_DIR := ./build
PREFIX := ~/.local
FLAGS := -a -b -c
app_name := dot-slash-make
dist_bin := ./dist/$(app_name).sh
script_files := $(wildcard ./src/*.sh ./*.sh ./make $(dist_bin))
ifndef NO_SELINUX
selinux_flag := -Z
endif
programs := a b c d e
artifacts := $(addprefix "$(BUILD_DIR)"/,$(programs))
.PHONY: dist
dist:
shellcheck $(script_files)
shfmt -d $(script_files)
./nice_modules/nice_things/nice_build.sh
shfmt -w $(dist_bin)
-diff ./dot-slash-make.sh $(dist_bin)
.PHONY: build
build:
./nice_modules/nice_things/nice_build.sh
-diff ./dot-slash-make.sh $(dist_bin)
mkdir -p "$(BUILD_DIR)"
touch $(artifacts)
.PHONY: install
install:
install -D $(selinux_flag) -m 755 -t $(PREFIX)/bin $(artifacts)
.PHONY: uninstall
uninstall:
rm -f $(addprefix $(PREFIX)/bin/,$(programs))
.PHONY: clean
clean:
-rm -r "$(BUILD_DIR)"
.PHONY: test
test:
-return 1
@echo 'This line is reachable because - ignores errors! FLAGS=$(FLAGS)'
return 1
@echo 'This line in unreachable'
.PHONY: lint
lint:
shellcheck $(script_files)
shfmt -d $(script_files)
.PHONY: format
format:
shfmt -w $(script_files)
.PHONY: dev-image
dev-image:
podman build -f Containerfile.dev -t $(app_name)-dev