-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
70 lines (51 loc) · 1.33 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
59
60
61
62
63
64
65
66
67
68
69
70
# Release tag
ifdef HPCDK_TAG
RELEASE_TAG := $(HPCDK_TAG)
else
RELEASE_TAG := main
endif
# Deployment bucket
ifdef HPCDK_S3_BUCKET
S3_BUCKET := $(HPCDK_S3_BUCKET)
else
S3_BUCKET := aws-hpc-recipes
endif
# CLI profile
ifdef HPCDK_PROFILE
PROFILE := $(HPCDK_PROFILE)
else
PROFILE := default
endif
PROJECTS ?= $(shell find recipes -name Makefile)
FILTER_OUT :=
PROJECTS := $(filter-out $(FILTER_OUT),$(PROJECTS))
%.ph_build :
+@$(MAKE) -C $(dir $*) $(MAKECMDGOALS)
%.ph_test :
+@$(MAKE) -C $(dir $*) test
%.ph_clean :
+@$(MAKE) -C $(dir $*) clean $(USE_DEVICE)
%.ph_clobber :
+@$(MAKE) -C $(dir $*) clobber $(USE_DEVICE)
all: $(addsuffix .ph_build,$(PROJECTS))
@echo "Finished building recipes"
build: $(addsuffix .ph_build,$(PROJECTS))
test : $(addsuffix .ph_test,$(PROJECTS))
tidy:
@find * | egrep "#" | xargs rm -f
@find * | egrep "\~" | xargs rm -f
clean: tidy $(addsuffix .ph_clean,$(PROJECTS))
clobber: clean $(addsuffix .ph_clobber,$(PROJECTS))
.PHONY: deploy
deploy:
@aws s3 sync --delete --acl public-read \
--exclude "*" --include "*/assets/*" --exclude "*/.gitkeep" \
recipes s3://${S3_BUCKET}/${RELEASE_TAG}/recipes/;\
.PHONY: readme
readme:
python -m scripts.render_readme
git add recipes/README.md
set_version:
$(eval RELEASE_TAG := $(shell git describe))
@echo ${RELEASE_TAG}
release: set_version readme deploy