-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (42 loc) · 1.14 KB
/
Makefile
File metadata and controls
44 lines (42 loc) · 1.14 KB
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
Q := $(if $(filter 1,$(V) $(VERBOSE)),,@)
MAKE := $(MAKE) $(if $(filter 1,$(V) $(VERBOSE)),,--no-print-directory)
MAKE += -j $(shell sh nproc.sh)
all: test
clean:
$Qrm -rf ./tmp
$Q$(MAKE) -C src clean
$Q$(MAKE) -C test clean
@printf "\033[0m"
fclean: clean
$Q$(MAKE) -C src fclean
$Q$(MAKE) -C test fclean
@printf "\033[0m"
re:
$Q$(MAKE) -C src fclean
$Q$(MAKE) test
init:
$Q$(MAKE) -C test init
deinit:
$Q$(MAKE) -C test deinit
reinit:
$Q$(MAKE) -C test reinit
refresh:
$Q$(MAKE) -C test refresh
test:
$Q$(MAKE) -C test test
@echo "Some test might need manual review"
publish_without_test:
ifndef GIT_REMOTE_URL
$(error GIT_REMOTE_URL is undefined)
endif
$Qrm -rf tmp
$Qcp -r ./src ./tmp
$Q$(MAKE) -C tmp fclean
$Qsh template.sh > tmp/Makefile
$Q(cd tmp && git init && git add . && git commit -m "Initial commit" && git push "$(GIT_REMOTE_URL)" HEAD:master) || (echo "Failed to publish" && false)
$Qrm -rf tmp
$Qgit push "$(GIT_REMOTE_URL)" HEAD:source | echo "Failed to push HEAD to source"
publish:
$Q$(MAKE) test
$Q$(MAKE) publish_without_test
.PHONY: all clean fclean re init deinit reinit refresh test publish publish_without_test