myos/make/monorepo/common.mk

103 lines
2.5 KiB
Makefile
Raw Normal View History

2021-02-09 17:05:00 +01:00
##
# COMMON
2021-06-02 00:54:33 +02:00
# target build: Fire APPS target
2021-02-09 17:05:00 +01:00
.PHONY: build
build: $(APPS) ## Build applications
2021-06-02 00:54:33 +02:00
# target build@%: Fire APPS target
2021-02-09 17:05:00 +01:00
.PHONY: build@%
build@%: $(APPS);
2021-06-02 00:54:33 +02:00
# target clean: Fire APPS target
2021-02-09 17:05:00 +01:00
.PHONY: clean
clean: $(APPS) ## Clean applications
2021-06-02 00:54:33 +02:00
# target clean@%: Fire APPS target
2021-02-09 17:05:00 +01:00
.PHONY: clean@%
clean@%: $(APPS);
2021-06-02 00:54:33 +02:00
# target config: Fire APPS target
2021-02-09 17:05:00 +01:00
.PHONY: config
config: $(APPS)
2021-06-02 00:54:33 +02:00
# target copy: Copy files and folders to all APPS
2021-02-09 17:05:00 +01:00
.PHONY: copy
copy:
2021-06-12 03:13:01 +02:00
$(foreach app,$(APPS),$(foreach file,$(ARGS),$(if $(wildcard $(file)),$(RUN) $(if $(filter LINUX,$(HOST_SYSTEM)),cp -a --parents $(file) $(app)/,rsync -a $(file) $(app)/$(file)) &&)) true &&) true
2021-02-09 17:05:00 +01:00
2021-06-02 00:54:33 +02:00
# target deploy: Fire APPS target
2021-02-09 17:05:00 +01:00
.PHONY: deploy
deploy: $(APPS) ## Deploy applications
2021-06-02 00:54:33 +02:00
# target deploy@%: Fire APPS target
2021-02-09 17:05:00 +01:00
.PHONY: deploy@%
deploy@%: $(APPS);
2021-06-02 00:54:33 +02:00
# target down: Fire APPS target
2021-02-09 17:05:00 +01:00
.PHONY: down
2021-06-02 00:54:33 +02:00
down: $(APPS) ## Remove applications dockers
2021-02-09 17:05:00 +01:00
2021-06-02 00:54:33 +02:00
# target install: Fire APPS target
.PHONY: install
install: $(APPS) ## Install applications
# target ps: Fire APPS target
2021-02-09 17:05:00 +01:00
.PHONY: ps
ps: $(APPS)
2021-06-02 00:54:33 +02:00
# target rebuild: Fire APPS target
2021-02-09 17:05:00 +01:00
.PHONY: rebuild
rebuild: $(APPS) ## Rebuild applications
2021-06-02 00:54:33 +02:00
# target recreate: Fire APPS target
2021-02-09 17:05:00 +01:00
.PHONY: recreate
recreate: $(APPS) ## Recreate applications
2021-06-02 00:54:33 +02:00
# target reinstall: Fire APPS target
2021-02-09 17:05:00 +01:00
.PHONY: reinstall
reinstall: $(APPS) ## Reinstall applications
2021-06-02 00:54:33 +02:00
# target release: Fire release-create target
.PHONY: release
release: release-create ## Create release VERSION
# target restart: Fire APPS target
2021-02-09 17:05:00 +01:00
.PHONY: restart
restart: $(APPS) ## Restart applications
2021-06-02 00:54:33 +02:00
# target start: Fire APPS target
2021-02-09 17:05:00 +01:00
.PHONY: start
start: $(APPS) ## Start applications
2021-06-02 00:54:33 +02:00
# target stop: Fire APPS target
2021-02-09 17:05:00 +01:00
.PHONY: stop
stop: $(APPS) ## Stop applications
2021-06-02 00:54:33 +02:00
# target tests: Fire APPS target
2021-02-09 17:05:00 +01:00
.PHONY: tests
tests: $(APPS) ## Test applications
2021-06-02 00:54:33 +02:00
# target up: Fire APPS target
2021-02-09 17:05:00 +01:00
.PHONY: up
2021-06-02 00:54:33 +02:00
up: $(APPS) ## Create applications dockers
# target update: Fire update-apps target
.PHONY: update
update: update-apps ## Update applications files
# target upgrade: Fire upgrade-apps and release-upgrade targets
.PHONY: upgrade
upgrade: upgrade-apps release-upgrade ## Upgrade applications
2021-02-09 17:05:00 +01:00
2021-06-02 00:54:33 +02:00
# target $(APPS): Call targets MAKECMDGOALS in folder $@
2021-02-09 17:05:00 +01:00
.PHONY: $(APPS)
$(APPS):
$(if $(wildcard $@/Makefile), \
2021-05-17 15:28:24 +02:00
$(call make,$(patsubst apps-%,%,$(MAKECMDGOALS)) STATUS=0,$(patsubst %/,%,$@),APP_PATH_PREFIX), \
2021-02-09 17:05:00 +01:00
printf "${COLOR_BROWN}WARNING${COLOR_RESET}: ${COLOR_GREEN}no app available in folder${COLOR_RESET} $@.\n" >&2)
2021-06-02 00:54:33 +02:00
# target apps-%: Fire $(APPS) target to call target % in $(APPS)
2021-02-09 17:05:00 +01:00
.PHONY: apps-%
2021-06-02 00:54:33 +02:00
apps-%: $(APPS) ;