2018-04-28 03:10:52 +08:00
|
|
|
SHELL = bash
|
|
|
|
|
2018-04-28 03:26:46 +08:00
|
|
|
BUILD_DIR = build
|
|
|
|
DEVEL_BUILD_DIR = $(BUILD_DIR)/devel
|
|
|
|
PROD_BUILD_DIR = $(BUILD_DIR)/prod
|
2018-04-28 03:10:52 +08:00
|
|
|
|
2018-04-28 03:26:46 +08:00
|
|
|
TEMPLATES_SRC_DIR = .
|
|
|
|
TEMPLATES_SRC_FILES = $(wildcard $(TEMPLATES_SRC_DIR)/*.tmpl)
|
2018-06-03 19:10:06 +08:00
|
|
|
TEMPLATES_DEVEL_BUILD_DIR = $(DEVEL_BUILD_DIR)/templates
|
2018-04-28 03:26:46 +08:00
|
|
|
TEMPLATES_DEVEL_BUILD_FILES = $(patsubst $(TEMPLATES_SRC_DIR)/%, $(TEMPLATES_DEVEL_BUILD_DIR)/%, $(TEMPLATES_SRC_FILES))
|
2018-06-03 19:10:06 +08:00
|
|
|
TEMPLATES_PROD_BUILD_DIR = $(PROD_BUILD_DIR)/templates
|
2018-04-28 03:26:46 +08:00
|
|
|
TEMPLATES_PROD_BUILD_FILES = $(patsubst $(TEMPLATES_SRC_DIR)/%, $(TEMPLATES_PROD_BUILD_DIR)/%, $(TEMPLATES_SRC_FILES))
|
2018-04-28 03:10:52 +08:00
|
|
|
|
|
|
|
devel: devel-templates
|
|
|
|
|
|
|
|
prod: prod-templates
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf $(BUILD_DIR)
|
|
|
|
|
2018-04-28 03:26:46 +08:00
|
|
|
devel-templates: $(TEMPLATES_DEVEL_BUILD_FILES)
|
2018-04-28 03:10:52 +08:00
|
|
|
|
2018-04-28 03:26:46 +08:00
|
|
|
$(TEMPLATES_DEVEL_BUILD_FILES): $(TEMPLATES_DEVEL_BUILD_DIR)/%.tmpl: $(TEMPLATES_SRC_DIR)/%.tmpl
|
2018-04-28 03:10:52 +08:00
|
|
|
cp $^ $@;
|
|
|
|
|
2018-04-28 03:26:46 +08:00
|
|
|
prod-templates: $(TEMPLATES_PROD_BUILD_FILES)
|
2018-04-28 03:10:52 +08:00
|
|
|
|
2018-04-28 03:26:46 +08:00
|
|
|
$(TEMPLATES_PROD_BUILD_FILES): $(TEMPLATES_PROD_BUILD_DIR)/%.tmpl: $(TEMPLATES_SRC_DIR)/%.tmpl
|
2018-04-28 03:10:52 +08:00
|
|
|
cp $^ $@;
|
|
|
|
|
2018-04-28 03:26:46 +08:00
|
|
|
$(shell mkdir -p $(TEMPLATES_DEVEL_BUILD_DIR) $(TEMPLATES_PROD_BUILD_DIR))
|