From 7703179d115c477be288fea5cd660bdb74c1a1b3 Mon Sep 17 00:00:00 2001 From: MP Date: Wed, 17 Feb 2021 17:39:35 +0100 Subject: [PATCH] simple Makefile and updated Readme with basic compile, install and removal instructions --- Makefile | 20 ++++++++++++++++++++ README.md | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..695258d --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +CC=gcc +NAME=matrix-effect + +ifdef OS + TERM=__WIN +else + TERM=__POSIX +endif + +build: main.c + ${CC} -D ${TERM} main.c -o ${NAME} + +install: ${NAME} + cp ${NAME} /usr/local/bin/${NAME} + +uninstall: + rm /usr/local/bin/${NAME} + +.PHONY clean: + rm ${NAME} diff --git a/README.md b/README.md index 064b250..19ccdad 100644 --- a/README.md +++ b/README.md @@ -6,3 +6,35 @@ Also your terminal needs to support ANSI escape codes, no other dependencies.\ It even looks kinda nice though. ![](matrix.gif) + +## Compile + +There's a simple makefile that tries to autodetect your OS and build the application accordingly, so it should be enough to run make: +``` +$ make +``` + +In case autodetection fails or you don't have make installed, you can always compile manually: +``` +$ gcc -D __POSIX main.c -o matrix-effect +or +$ gcc -D __WIN main.c -o matrix-effect +``` + +## Install + +If for whatever reason you'd like to be able to run this application from anywhere at all times, you can install it: +``` +$ sudo make install +``` +Afterwards you can run this command from anywhere +``` +$ matrix-effect +``` + +## Uninstall + +And if you want to get rid of it: +``` +$ sudo make uninstall +``` \ No newline at end of file