forked from java-cli-apps/basic-java-22-quickstart
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (32 loc) · 1.31 KB
/
Makefile
File metadata and controls
42 lines (32 loc) · 1.31 KB
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
39
40
41
42
help: ## Afficher l'aide
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; { printf("\033[36m%-20s\033[0m %s\n", $$1, $$2) }'
package: build ## Construire le livrable de l'application dans un fichier .zip
cd $(BUILD) \
&& zip --quiet --recurse-paths $(APP_NAME).zip $(APP_DIR)
install: .check-install-dir ## Installer l'application
unzip -q -d $(DEST_DIR) $(BUILD)/$(APP_NAME).zip
build: ## Construire l'application
mkdir --parents $(BUILD_APP) \
&& cp --update --recursive src lib bin $(BUILD_APP) \
&& cd $(BUILD_APP) \
&& mv src/$(STARTER_APP).java src/$(APP_NAME).java \
&& mv bin/$(STARTER_APP).sh bin/$(APP_NAME).sh
clean: ## Nettoyer le répertoire de construction
rm --force --recursive $(BUILD)
run-app: ## Lancer l'application localement
./bin/$(STARTER_APP).sh
run-app-from-java: ## Lancer l'application localement (en lançant le fichier .java)
./src/$(STARTER_APP).java
run-installed-app: .check-install-dir ## Lancer l'application installée
PATH=$(DEST_DIR)/$(APP_DIR)/bin:$(PATH) $(APP_NAME).sh
.check-install-dir:
ifndef DEST_DIR
$(error Please set the installation directory, for example DEST_DIR=~ make install)
endif
.PHONY: build
APP_NAME ?= BasicQuickstart
APP_DIR := $(APP_NAME)
BUILD := build
BUILD_APP := $(BUILD)/$(APP_DIR)
STARTER_APP := Application