aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJoel Kronqvist <joelkronqvist@proton.me>2024-04-14 10:30:26 +0300
committerJoel Kronqvist <joel.kronqvist@iki.fi>2024-04-15 10:24:56 +0300
commit6c4ec5c0bd46b1292d15a789560fb5acd813bbce (patch)
treeba459e6914f6e37e6e89d97c8eedadbc8c65a210 /Makefile
parentba5dd828bde07493ef5f2f8abf6921e0a040133d (diff)
downloadstdu-6c4ec5c0bd46b1292d15a789560fb5acd813bbce.tar.gz
stdu-6c4ec5c0bd46b1292d15a789560fb5acd813bbce.zip
Added installation and `-O3` in Makefile, created manpage and README and licensed under the MIT license
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile35
1 files changed, 28 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index e5bfd68..0b66d0d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,25 +1,46 @@
+BINPATH = /usr/local/bin
+MANPATH = /usr/local/share/man
+
stdu : stdu.o intmath.o intmath.h config-parser.h config-parser.o formatting.o \
formatting.h
- cc -g -o stdu stdu.o intmath.o config-parser.o formatting.o
+ cc -lm -O3 -o stdu stdu.o intmath.o config-parser.o formatting.o
stdu.o : stdu.c
- cc -g -c stdu.c
+ cc -O3 -c stdu.c
formatting.o : formatting.h formatting.c intmath.h intmath.c minitest.h
- cc -g -c formatting.c
+ cc -O3 -c formatting.c
intmath.o : intmath.c minitest.h intmath.h
- cc -g -c intmath.c
+ cc -O3 -c intmath.c
config-parser.o : config-parser.c config-parser.h minitest.h
- cc -g -c config-parser.c
+ cc -O3 -c config-parser.c
tests : tests.c minitest.h intmath.c config-parser.c formatting.c
- cc -g -o tests tests.c
+ cc -lm -O3 -o tests tests.c
test : tests
./tests
+
+.PHONY: clean cleanall install uninstall
+
+install : stdu
+ mkdir -p ${BINPATH}
+ cp -f stdu ${BINPATH}
+ chmod 755 ${BINPATH}/stdu
+ mkdir -p ${MANPATH}/man1
+ cp -f stdu.1 ${MANPATH}/man1
+ chmod 644 ${MANPATH}/man1/stdu.1
+
+uninstall :
+ -rm -f ${BINPATH}/stdu
+ -rm -f ${MANPATH}/man1/stdu.1
+
clean :
- rm stdu stdu.o intmath.o tests config-parser.o formatting.o
+ -rm stdu.o intmath.o tests config-parser.o formatting.o
+
+cleanall: clean
+ -rm stdu