mirror of
https://github.com/alexpasmantier/television.git
synced 2025-06-07 12:05:34 +00:00
chore: update Makefile and CONTRIBUTING.md
This commit is contained in:
parent
6eafb7bfe8
commit
2e49862a7e
@ -63,12 +63,16 @@ configuration:
|
|||||||
|
|
||||||
To build the project in debug mode, run the following command in the project directory:
|
To build the project in debug mode, run the following command in the project directory:
|
||||||
```shell
|
```shell
|
||||||
make build_debug
|
make
|
||||||
|
```
|
||||||
|
or
|
||||||
|
```shell
|
||||||
|
make build
|
||||||
```
|
```
|
||||||
|
|
||||||
To build the project in release mode, run the following command in the project directory:
|
To build the project in release mode, run the following command in the project directory:
|
||||||
```shell
|
```shell
|
||||||
make build_release
|
make release
|
||||||
```
|
```
|
||||||
Formatting the code
|
Formatting the code
|
||||||
```shell
|
```shell
|
||||||
|
52
Makefile
52
Makefile
@ -1,9 +1,4 @@
|
|||||||
VERSION=0.3.13
|
default: build
|
||||||
NAME=television
|
|
||||||
EXEC=tv
|
|
||||||
PREFIX=$(HOME)/.local
|
|
||||||
|
|
||||||
default: build_release
|
|
||||||
|
|
||||||
setup:
|
setup:
|
||||||
@echo "Setting up $(NAME)"
|
@echo "Setting up $(NAME)"
|
||||||
@ -23,11 +18,11 @@ check:
|
|||||||
@echo "Checking $(NAME)"
|
@echo "Checking $(NAME)"
|
||||||
@cargo check
|
@cargo check
|
||||||
|
|
||||||
build_release:
|
release:
|
||||||
@echo "Building release: $(VERSION)"
|
@echo "Building release: $(VERSION)"
|
||||||
@cargo build --release
|
@cargo build --release
|
||||||
|
|
||||||
build_debug:
|
build:
|
||||||
@echo "Building debug"
|
@echo "Building debug"
|
||||||
@cargo build
|
@cargo build
|
||||||
|
|
||||||
@ -50,43 +45,4 @@ run:
|
|||||||
|
|
||||||
test:
|
test:
|
||||||
@echo "Testing $(NAME)"
|
@echo "Testing $(NAME)"
|
||||||
@cargo test
|
@cargo test --all
|
||||||
|
|
||||||
install_debug: build_debug
|
|
||||||
@echo "Installing debug"
|
|
||||||
@cp target/debug/$(EXEC) $(PREFIX)/bin
|
|
||||||
|
|
||||||
install: build_release
|
|
||||||
@echo "Installing release: $(VERSION)"
|
|
||||||
@cp target/release/$(EXEC) $(PREFIX)/bin
|
|
||||||
|
|
||||||
dist: build_release
|
|
||||||
@if [ ! -d ./pkg ]; \
|
|
||||||
then \
|
|
||||||
mkdir ./pkg; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
@if [ -d ./pkg/$(NAME)-$(VERSION) ]; \
|
|
||||||
then \
|
|
||||||
echo "Current version number already exists! Removing old files!"; \
|
|
||||||
rm -rf ./pkg/$(NAME)-$(VERSION); \
|
|
||||||
fi
|
|
||||||
|
|
||||||
@mkdir ./pkg/$(NAME)-$(VERSION)
|
|
||||||
|
|
||||||
@cp ./dist-scripts/install.sh ./pkg/$(NAME)-$(VERSION)/
|
|
||||||
|
|
||||||
@sed -i 's#{prefix}#$(PREFIX)#g' ./pkg/$(NAME)-$(VERSION)/install.sh
|
|
||||||
@sed -i 's#{version}#$(VERSION)#g' ./pkg/$(NAME)-$(VERSION)/install.sh
|
|
||||||
@sed -i 's#{name}#$(NAME)#g' ./pkg/$(NAME)-$(VERSION)/install.sh
|
|
||||||
@sed -i 's#{exec}#$(EXEC)#g' ./pkg/$(NAME)-$(VERSION)/install.sh
|
|
||||||
|
|
||||||
@mkdir ./pkg/$(NAME)-$(VERSION)/files
|
|
||||||
@cp target/release/$(EXEC) ./pkg/$(NAME)-$(VERSION)/files/
|
|
||||||
@strip ./pkg/$(NAME)-$(VERSION)/files/$(EXEC)
|
|
||||||
|
|
||||||
@cp LICENSE ./pkg/$(NAME)-$(VERSION)/
|
|
||||||
|
|
||||||
@cd ./pkg && tar -czf ./$(NAME)-$(VERSION).tar.gz ./$(NAME)-$(VERSION)
|
|
||||||
@echo "Cleaning up"
|
|
||||||
@rm -rf ./pkg/$(NAME)-$(VERSION)
|
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
PREFIX={prefix}
|
|
||||||
VERSION={version}
|
|
||||||
NAME={name}
|
|
||||||
EXEC={exec}
|
|
||||||
|
|
||||||
if [ $1 == "uninstall" ]
|
|
||||||
then
|
|
||||||
echo "Uninstalling $NAME"
|
|
||||||
rm -rf $PREFIX/bin/$EXEC
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $1 == "help" ]
|
|
||||||
then
|
|
||||||
echo "\`./install.sh uninstall' to uninstall the program."
|
|
||||||
echo "\`./install.sh' or \`./install.sh install' to install the program."
|
|
||||||
echo "\`./install.sh' help to show this page."
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Installing $NAME, version: $VERSION, into: $PREFIX/bin/$EXEC"
|
|
||||||
|
|
||||||
cp files/$EXEC $PREFIX/bin/
|
|
Loading…
x
Reference in New Issue
Block a user