forked from MetisMachine/skafos
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
56 lines (40 loc) · 1.29 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
.PHONY: test build version
VERSION_FILE=VERSION
VERSION=`cat $(VERSION_FILE)`
BUILD_DIR=_build
all: build
_start_release:
@echo "Creating release for version $(VERSION)..."
_tag_release:
@git tag -a $(VERSION) -m "Creating release for version $(VERSION)"
@git push --tags
_create_version_h:
@rm -rf src/version.h && \
printf "#ifndef __CLI_VERSION__\n#define __CLI_VERSION__\n\n#define VERSION \"$(VERSION)\"\n\n#endif\n\n" >> src/version.h
_create_dev_version_h:
@rm -rf src/version.h && \
printf "#ifndef __CLI_VERSION__\n#define __CLI_VERSION__\n\n#define VERSION \"$(VERSION)-dev\"\n\n#endif\n\n" >> src/version.h
_env_for_staging:
@cp build_envs/staging_env.h src/cli_env.h
_env_for_prod:
@cp build_envs/production_env.h src/cli_env.h
build: clean _create_dev_version_h _env_for_staging
@cd $(BUILD_DIR) \
&& echo "Building skafos..." \
&& cmake .. -Wno-dev \
&& make
build_dev: clean _create_dev_version_h _env_for_staging
@cd $(BUILD_DIR) \
&& echo "Building skafos..." \
&& cmake .. -Wno-dev \
&& make
build_dist: clean _create_version_h _env_for_prod
@cd $(BUILD_DIR) \
&& echo "Building skafos..." \
&& cmake .. -Wno-dev \
&& make \
&& cpack --config CPackConfig.cmake
clean:
@rm -rf _build/*
release: _start_release clean build_dist _tag_release
homebrew: clean build_dist