-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (40 loc) · 1.72 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
VERSION := $(shell cat VERSION)
BUILD_TIME := $(shell date --utc --rfc-3339 ns 2> /dev/null | sed -e 's/ /T/')
GIT_COMMIT := $(shell git rev-parse --short HEAD 2> /dev/null || true)
ifndef ECFLOW_BUILD_DIR
$(error ECFLOW_BUILD_DIR is not set)
endif
ifndef ECFLOW_SOURCE_DIR
$(error ECFLOW_SOURCE_DIR is not set)
endif
ifndef BOOST_LIB_DIR
$(error BOOST_LIB_DIR is not set)
endif
CGO_CXXFLAGS += -I$(pwd)/ecflow_client_standalone
CGO_CXXFLAGS += -I${ECFLOW_SOURCE_DIR}/ACore/src
CGO_CXXFLAGS += -I${ECFLOW_SOURCE_DIR}/ANattr/src
CGO_CXXFLAGS += -I${ECFLOW_SOURCE_DIR}/ANode/src
CGO_CXXFLAGS += -I${ECFLOW_SOURCE_DIR}/Base/src
CGO_CXXFLAGS += -I${ECFLOW_SOURCE_DIR}/Base/src/cts
CGO_CXXFLAGS += -I${ECFLOW_SOURCE_DIR}/Base/src/stc
CGO_CXXFLAGS += -I${ECFLOW_SOURCE_DIR}/CSim/src
CGO_CXXFLAGS += -I${ECFLOW_SOURCE_DIR}/Client/src
CGO_CXXFLAGS += -Wno-deprecated-declarations
export CGO_CXXFLAGS
CGO_LDFLAGS += -L${ECFLOW_BUILD_DIR}/Client -llibclient
CGO_LDFLAGS += -L${ECFLOW_BUILD_DIR}/Base -lbase
CGO_LDFLAGS += -L${ECFLOW_BUILD_DIR}/CSim -llibsimu
CGO_LDFLAGS += -L${ECFLOW_BUILD_DIR}/ANode -lnode
CGO_LDFLAGS += -L${ECFLOW_BUILD_DIR}/ANattr -lnodeattr
CGO_LDFLAGS += -L${ECFLOW_BUILD_DIR}/ACore -lcore
CGO_LDFLAGS += -L${BOOST_LIB_DIR} -lboost_system-mt -lboost_filesystem-mt -lboost_date_time-mt -lboost_program_options-mt -lboost_serialization-mt -lboost_thread-mt -lboost_regex-mt
export CGO_LDFLAGS
export BIN_PATH := $(shell pwd)/bin
.PHONY: cmd
cmd:
go build \
-ldflags "-X \"github.com/nwpc-oper/ecflow-watchman.Version=${VERSION}\" \
-X \"github.com/nwpc-oper/ecflow-watchman.BuildTime=${BUILD_TIME}\" \
-X \"github.com/nwpc-oper/ecflow-watchman.GitCommit=${GIT_COMMIT}\" " \
-o bin/ecflow_watchman \
cmd/main.go