cli(make): Ajoute de quoi installer et désinstaller
This commit is contained in:
10
README.md
10
README.md
@@ -31,6 +31,16 @@ On Debian: `apt install clang-format gcovr`
|
||||
Quick setup
|
||||
-----------
|
||||
|
||||
```bash
|
||||
cd cli
|
||||
./configure.sh -d
|
||||
make BUILD=release
|
||||
sudo make install BUILD=release
|
||||
```
|
||||
|
||||
Development
|
||||
-----------
|
||||
|
||||
### Create a sample database and run the server
|
||||
```bash
|
||||
cd sql && ./create_sqlite_db.sh && cd ..
|
||||
|
20
cli/Makefile
20
cli/Makefile
@@ -19,6 +19,13 @@ LDLIBS := -lcurl -lminizip # Bibliothèques utilisées pour l'édition des liens
|
||||
|
||||
# Nom de l'exécutable final
|
||||
TARGET_EXE := oki
|
||||
TARGET_VERSION := 0.1.0
|
||||
|
||||
# Répertoire d'installation
|
||||
prefix := /usr/local
|
||||
exec_prefix := $(prefix)
|
||||
bindir := $(exec_prefix)/bin
|
||||
INSTALL_BIN_DIR := $(DESTDIR)/$(bindir)
|
||||
|
||||
# Répertoires des fichiers compilés et de sources
|
||||
BUILD_DIR := build/$(BUILD)
|
||||
@@ -74,6 +81,19 @@ format:
|
||||
coverage.html: $(TARGET_EXE)-test build/test/test/main.o
|
||||
./$(TARGET_EXE)-test && gcovr -r src -d build --html coverage.html
|
||||
|
||||
# Installe l'exécutable final
|
||||
install: $(TARGET_EXE)
|
||||
install -d $(INSTALL_BIN_DIR)
|
||||
install -m 755 $(TARGET_EXE) $(INSTALL_BIN_DIR)
|
||||
|
||||
# Supprime l'exécutable installé
|
||||
uninstall:
|
||||
rm -f $(INSTALL_BIN_DIR)/$(TARGET_EXE)
|
||||
|
||||
# Réalise une archive des fichiers sources
|
||||
dist:
|
||||
tar -czvf $(TARGET_EXE)-$(TARGET_VERSION).tar.gz --transform='s,^,$(TARGET_EXE)-$(TARGET_VERSION)/,' src Makefile configure.sh
|
||||
|
||||
.PHONY: all clean doc format
|
||||
|
||||
# Inclut les Makefiles de chaque fichier source
|
||||
|
Reference in New Issue
Block a user