-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (22 loc) · 948 Bytes
/
Makefile
File metadata and controls
30 lines (22 loc) · 948 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
DIST_DIR := dist
CROSS_TARGET := x86_64-unknown-freebsd
LCATRS_ROOT := ./lcat-rs
LCATRS_RELEASE_DIR := $(LCATRS_ROOT)/target/$(CROSS_TARGET)/release
RUST_SOURCES := $(shell find $(LCATRS_ROOT)/src -type f)
CGI_FILES := $(patsubst $(LCATRS_ROOT)/src/bin/%.rs, %.cgi, $(wildcard $(LCATRS_ROOT)/src/bin/*.rs))
PHP_FILES := $(filter-out config.php, $(wildcard *.php))
STATIC_FILES := style.css robots.txt LICENSE
.PHONY: all deploy clean
all: $(addprefix $(DIST_DIR)/, $(CGI_FILES))
cp $(PHP_FILES) $(STATIC_FILES) $(DIST_DIR)
$(DIST_DIR):
mkdir -p $(DIST_DIR)
$(DIST_DIR)/%.cgi: $(LCATRS_RELEASE_DIR)/% | $(DIST_DIR)
cp $< $@
$(LCATRS_RELEASE_DIR)/%: $(RUST_SOURCES)
cross build --manifest-path $(LCATRS_ROOT)/Cargo.toml --target $(CROSS_TARGET) --release
deploy: all
rsync -rzh --stats $(DIST_DIR)/ lcat.dev:/home/public
clean:
rm -rf $(DIST_DIR)
cross clean --manifest-path $(LCATRS_ROOT)/Cargo.toml --target $(CROSS_TARGET)