-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (30 loc) · 955 Bytes
/
Makefile
File metadata and controls
38 lines (30 loc) · 955 Bytes
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
.PHONY: build release copy-templates-debug copy-templates-release clean
ifeq ($(shell echo "check_quotes"),"check_quotes")
WINDOWS := yes
else
WINDOWS := no
endif
ifeq ($(WINDOWS),yes)
mkdir = mkdir $(subst /,\,$(1)) > nul 2>&1 || (exit 0)
cp = xcopy /E /I /Y $(subst /,\,$(1)) $(subst /,\,$(2)) > nul 2>&1 || (exit 0)
echo = echo $(1)
else
mkdir = mkdir -p $(1)
cp = cp -r $(1) $(2)
echo = echo "$(1)"
endif
all: build
build: copy-templates-debug
cargo build
release: copy-templates-release
cargo build --release
copy-templates-debug:
@$(call echo,Copying template files to target/debug...)
@$(call mkdir,target/debug/hamdata_templates)
@$(call cp,hamdata_templates/*,target/debug/hamdata_templates)
copy-templates-release:
@$(call echo,Copying template files to target/release...)
@$(call mkdir,target/release/hamdata_templates)
@$(call cp,hamdata_templates/*,target/release/hamdata_templates)
clean:
cargo clean