forked from daeuniverse/daed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (48 loc) · 1.26 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
OUTPUT ?= daed
APPNAME ?= daed
VERSION ?= 0.0.0.unknown
.PHONY: submodules submodule
daed:
all: clean daed
clean:
rm -rf dist && rm -f daed
## Begin Git Submodules
.gitmodules.d.mk: .gitmodules Makefile
@set -e && \
submodules=$$(grep '\[submodule "' .gitmodules | cut -d'"' -f2 | tr '\n' ' ' | tr ' \n' '\n' | sed 's/$$/\/.git/g') && \
echo "submodule_ready=$${submodules}" > $@
-include .gitmodules.d.mk
$(submodule_ready): .gitmodules.d.mk
ifdef SKIP_SUBMODULES
@echo "Skipping submodule update"
else
git submodule update --init --recursive -- "$$(dirname $@)" && \
touch $@
endif
submodule submodules: $(submodule_ready)
@if [ -z "$(submodule_ready)" ]; then \
rm -f .gitmodules.d.mk; \
echo "Failed to generate submodules list. Please try again."; \
exit 1; \
fi
## End Git Submodules
## Begin Web
PFLAGS ?=
ifeq (,$(wildcard ./.git))
PFLAGS += HUSKY=0
endif
dist: package.json pnpm-lock.yaml
$(PFLAGS) pnpm i
pnpm build
## End Web
## Begin Bundle
DAE_WING_READY=wing/graphql/service/config/global/generated_resolver.go
$(DAE_WING_READY): wing
cd wing && \
$(MAKE) deps && \
cd .. && \
touch $@
daed: submodule $(DAE_WING_READY) dist
cd wing && \
$(MAKE) OUTPUT=../$(OUTPUT) APPNAME=$(APPNAME) WEB_DIST=../dist VERSION=$(VERSION) bundle
## End Bundle