forked from free5gc/webconsole
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
28 lines (21 loc) · 775 Bytes
/
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
GO_BIN_PATH = bin
WEBCONSOLE = webconsole
WEBCONSOLE_GO_FILES = $(shell find -name "*.go" ! -name "*_test.go")
WEBCONSOLE_JS_FILES = $(shell find ./frontend -name '*.tsx' ! -path "*/node_modules/*")
WEBCONSOLE_FRONTEND = ./public
debug: GCFLAGS += -N -l
$(WEBCONSOLE): $(GO_BIN_PATH)/$(WEBCONSOLE) $(WEBCONSOLE_FRONTEND)
$(GO_BIN_PATH)/$(WEBCONSOLE): server.go $(WEBCONSOLE_GO_FILES)
@echo "Start building $(@F)...."
CGO_ENABLED=0 go build -ldflags "$(WEBCONSOLE_LDFLAGS)" -o $@ ./server.go
$(WEBCONSOLE_FRONTEND): $(WEBCONSOLE_JS_FILES)
@echo "Start building $(@F) frontend...."
cd frontend && \
sudo corepack enable && \
yarn install && \
yarn build && \
rm -rf ../public && \
cp -R build ../public
clean:
rm -rf $(GO_BIN_PATH)/$(WEBCONSOLE)
rm -rf public