-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
31 lines (24 loc) · 1.37 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
CODE_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
CWD := ${CURDIR}
BIN_DIR := $(CODE_DIR)/build
BINPATH := \
$(BIN_DIR)/partitioner \
$(BIN_DIR)/merger \
$(BIN_DIR)/apiHandler \
$(BIN_DIR)/composer \
$(BIN_DIR)/dispatcher
SRC := $(CODE_DIR)/internal/*.go $(CODE_DIR)/internal/*/*.go $(CODE_DIR)/pkg/*/*.go
all: build
clean:
rm -f $(BINPATH)
build: $(BINPATH)
$(BIN_DIR)/partitioner: $(CODE_DIR)/lambda/partitioner/*.go $(SRC)
cd $(CODE_DIR) && env GOARCH=amd64 GOOS=linux go build -v $(BUILD_OPT) -o $(BIN_DIR)/partitioner $(CODE_DIR)/lambda/partitioner && cd $(CWD)
$(BIN_DIR)/merger: $(CODE_DIR)/lambda/merger/*.go $(SRC)
cd $(CODE_DIR) && env GOARCH=amd64 GOOS=linux go build -v $(BUILD_OPT) -o $(BIN_DIR)/merger $(CODE_DIR)/lambda/merger && cd $(CWD)
$(BIN_DIR)/composer: $(CODE_DIR)/lambda/composer/*.go $(SRC)
cd $(CODE_DIR) && env GOARCH=amd64 GOOS=linux go build -v $(BUILD_OPT) -o $(BIN_DIR)/composer $(CODE_DIR)/lambda/composer && cd $(CWD)
$(BIN_DIR)/dispatcher: $(CODE_DIR)/lambda/dispatcher/*.go $(SRC)
cd $(CODE_DIR) && env GOARCH=amd64 GOOS=linux go build -v $(BUILD_OPT) -o $(BIN_DIR)/dispatcher $(CODE_DIR)/lambda/dispatcher && cd $(CWD)
$(BIN_DIR)/apiHandler: $(CODE_DIR)/lambda/apiHandler/*.go $(SRC)
cd $(CODE_DIR) && env GOARCH=amd64 GOOS=linux go build -v $(BUILD_OPT) -o $(BIN_DIR)/apiHandler $(CODE_DIR)/lambda/apiHandler && cd $(CWD)