From 4504048f870bc141e33f370548822e8a7c8651a2 Mon Sep 17 00:00:00 2001 From: Adhityaa Date: Sat, 28 Apr 2018 00:56:46 +0530 Subject: [PATCH] templates/Makefile: change TMPL_* to TEMPLATES_* --- Makefile | 49 +++++++++++++++++++++++++++------------------- templates/Makefile | 28 +++++++++++++------------- 2 files changed, 43 insertions(+), 34 deletions(-) diff --git a/Makefile b/Makefile index 8b9c05e..7c446cf 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,26 @@ SHELL = bash -BUILD_DIR = build -DEVEL_BUILD_DIR = $(BUILD_DIR)/devel -PROD_BUILD_DIR = $(BUILD_DIR)/prod +BUILD_DIR = build +DEVEL_BUILD_DIR = $(BUILD_DIR)/devel +PROD_BUILD_DIR = $(BUILD_DIR)/prod -FRONTEND_BUILD_DIR = frontend -FRONTEND_DEVEL_BUILD_DIR = $(FRONTEND_BUILD_DIR)/$(DEVEL_BUILD_DIR) -FRONTEND_PROD_BUILD_DIR = $(FRONTEND_BUILD_DIR)/$(PROD_BUILD_DIR) +FRONTEND_BUILD_DIR = frontend +FRONTEND_DEVEL_BUILD_DIR = $(FRONTEND_BUILD_DIR)/$(DEVEL_BUILD_DIR) +FRONTEND_DEVEL_ROOT_DIR = $(DEVEL_BUILD_DIR) +FRONTEND_PROD_BUILD_DIR = $(FRONTEND_BUILD_DIR)/$(PROD_BUILD_DIR) +FRONTEND_PROD_ROOT_DIR = $(PROD_BUILD_DIR) -API_BUILD_DIR = api -API_DEVEL_BUILD_DIR = $(API_BUILD_DIR)/$(DEVEL_BUILD_DIR) -API_PROD_BUILD_DIR = $(API_BUILD_DIR)/$(PROD_BUILD_DIR) +API_BUILD_DIR = api +API_DEVEL_BUILD_DIR = $(API_BUILD_DIR)/$(DEVEL_BUILD_DIR) +API_DEVEL_ROOT_DIR = $(DEVEL_BUILD_DIR) +API_PROD_BUILD_DIR = $(API_BUILD_DIR)/$(PROD_BUILD_DIR) +API_PROD_ROOT_DIR = $(PROD_BUILD_DIR) -TMPL_BUILD_DIR = templates -TMPL_DEVEL_BUILD_DIR = $(TMPL_BUILD_DIR)/$(DEVEL_BUILD_DIR) -TMPL_PROD_BUILD_DIR = $(TMPL_BUILD_DIR)/$(PROD_BUILD_DIR) +TEMPLATES_BUILD_DIR = templates +TEMPLATES_DEVEL_BUILD_DIR = $(TEMPLATES_BUILD_DIR)/$(DEVEL_BUILD_DIR) +TEMPLATES_DEVEL_ROOT_DIR = $(DEVEL_BUILD_DIR)/templates +TEMPLATES_PROD_BUILD_DIR = $(TEMPLATES_BUILD_DIR)/$(PROD_BUILD_DIR) +TEMPLATES_PROD_ROOT_DIR = $(PROD_BUILD_DIR)/templates devel: frontend api templates devel-copy @@ -40,24 +46,24 @@ devel-copy: devel-copy-frontend devel-copy-api devel-copy-templates prod-copy: prod-copy-frontend prod-copy-api prod-copy-templates devel-copy-frontend: - cp -r $(FRONTEND_DEVEL_BUILD_DIR)/* $(DEVEL_BUILD_DIR) + cp -r $(FRONTEND_DEVEL_BUILD_DIR)/* $(FRONTEND_DEVEL_ROOT_DIR) devel-copy-api: - cp -r $(API_DEVEL_BUILD_DIR)/* $(DEVEL_BUILD_DIR) + cp -r $(API_DEVEL_BUILD_DIR)/* $(API_DEVEL_ROOT_DIR) devel-copy-templates: - cp -r $(TMPL_DEVEL_BUILD_DIR)/* $(DEVEL_BUILD_DIR) + cp -r $(TEMPLATES_DEVEL_BUILD_DIR)/* $(TEMPLATES_DEVEL_ROOT_DIR) prod-copy-frontend: - cp -r $(FRONTEND_PROD_BUILD_DIR)/* $(PROD_BUILD_DIR) + cp -r $(FRONTEND_PROD_BUILD_DIR)/* $(FRONTEND_PROD_ROOT_DIR) prod-copy-api: - cp -r $(API_PROD_BUILD_DIR)/* $(PROD_BUILD_DIR) + cp -r $(API_PROD_BUILD_DIR)/* $(API_PROD_ROOT_DIR) prod-copy-templates: - cp -r $(TMPL_PROD_BUILD_DIR)/* $(PROD_BUILD_DIR) + cp -r $(TEMPLATES_PROD_BUILD_DIR)/* $(TEMPLATES_PROD_ROOT_DIR) -clean: clean-root clean-frontend clean-api +clean: clean-root clean-frontend clean-api clean-templates clean-root: rm -rf build @@ -68,4 +74,7 @@ clean-frontend: clean-api: cd api && $(MAKE) $(MAKECMDGOALS) -$(shell mkdir -p $(DEVEL_BUILD_DIR) $(PROD_BUILD_DIR)) +clean-templates: + cd templates && $(MAKE) $(MAKECMDGOALS) + +$(shell mkdir -p $(FRONTEND_DEVEL_ROOT_DIR) $(API_DEVEL_ROOT_DIR) $(TEMPLATES_DEVEL_ROOT_DIR) $(FRONTEND_PROD_ROOT_DIR) $(API_PROD_ROOT_DIR) $(TEMPLATES_DEVEL_ROOT_DIR)) diff --git a/templates/Makefile b/templates/Makefile index 789a949..4ef3964 100644 --- a/templates/Makefile +++ b/templates/Makefile @@ -1,15 +1,15 @@ SHELL = bash -BUILD_DIR = build -DEVEL_BUILD_DIR = $(BUILD_DIR)/devel -PROD_BUILD_DIR = $(BUILD_DIR)/prod +BUILD_DIR = build +DEVEL_BUILD_DIR = $(BUILD_DIR)/devel +PROD_BUILD_DIR = $(BUILD_DIR)/prod -TMPL_SRC_DIR = . -TMPL_SRC_FILES = $(wildcard $(TMPL_SRC_DIR)/*.tmpl) -TMPL_DEVEL_BUILD_DIR = $(DEVEL_BUILD_DIR) -TMPL_DEVEL_BUILD_FILES = $(patsubst $(TMPL_SRC_DIR)/%, $(TMPL_DEVEL_BUILD_DIR)/%, $(TMPL_SRC_FILES)) -TMPL_PROD_BUILD_DIR = $(PROD_BUILD_DIR) -TMPL_PROD_BUILD_FILES = $(patsubst $(TMPL_SRC_DIR)/%, $(TMPL_PROD_BUILD_DIR)/%, $(TMPL_SRC_FILES)) +TEMPLATES_SRC_DIR = . +TEMPLATES_SRC_FILES = $(wildcard $(TEMPLATES_SRC_DIR)/*.tmpl) +TEMPLATES_DEVEL_BUILD_DIR = $(DEVEL_BUILD_DIR) +TEMPLATES_DEVEL_BUILD_FILES = $(patsubst $(TEMPLATES_SRC_DIR)/%, $(TEMPLATES_DEVEL_BUILD_DIR)/%, $(TEMPLATES_SRC_FILES)) +TEMPLATES_PROD_BUILD_DIR = $(PROD_BUILD_DIR) +TEMPLATES_PROD_BUILD_FILES = $(patsubst $(TEMPLATES_SRC_DIR)/%, $(TEMPLATES_PROD_BUILD_DIR)/%, $(TEMPLATES_SRC_FILES)) devel: devel-templates @@ -18,14 +18,14 @@ prod: prod-templates clean: rm -rf $(BUILD_DIR) -devel-templates: $(TMPL_DEVEL_BUILD_FILES) +devel-templates: $(TEMPLATES_DEVEL_BUILD_FILES) -$(TMPL_DEVEL_BUILD_FILES): $(TMPL_DEVEL_BUILD_DIR)/%.tmpl: $(TMPL_SRC_DIR)/%.tmpl +$(TEMPLATES_DEVEL_BUILD_FILES): $(TEMPLATES_DEVEL_BUILD_DIR)/%.tmpl: $(TEMPLATES_SRC_DIR)/%.tmpl cp $^ $@; -prod-templates: $(TMPL_PROD_BUILD_FILES) +prod-templates: $(TEMPLATES_PROD_BUILD_FILES) -$(TMPL_PROD_BUILD_FILES): $(TMPL_PROD_BUILD_DIR)/%.tmpl: $(TMPL_SRC_DIR)/%.tmpl +$(TEMPLATES_PROD_BUILD_FILES): $(TEMPLATES_PROD_BUILD_DIR)/%.tmpl: $(TEMPLATES_SRC_DIR)/%.tmpl cp $^ $@; -$(shell mkdir -p $(TMPL_DEVEL_BUILD_DIR) $(TMPL_PROD_BUILD_DIR)) +$(shell mkdir -p $(TEMPLATES_DEVEL_BUILD_DIR) $(TEMPLATES_PROD_BUILD_DIR))