aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Makefile
diff options
context:
space:
mode:
authorGravatar Tim Segers <tsegers@pm.me>2022-10-10 19:02:09 +0200
committerGravatar Tim Segers <tsegers@pm.me>2022-10-10 19:04:05 +0200
commit07cac4282bf721e75d70f1811f55152989a6a7c5 (patch)
tree5df91da711ee5a4368e8b34fba4651bd0f960406 /Makefile
parent8c5571544169a4095ceebf5f6d6b5b9caf09c59b (diff)
downloadopendeco-07cac4282bf721e75d70f1811f55152989a6a7c5.tar.gz
Add lib target to Makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 13 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index ddae9d9..d852232 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ VERSION=\"$(shell git describe --tags --dirty)\"
PREFIX = /usr/local
-all: opendeco opendeco_test
+all: opendeco opendeco_test libopendeco.a
opendeco: src/opendeco.c src/deco.c src/deco.h src/schedule.c src/schedule.h src/output.c src/output.h
gcc --std=c99 -pedantic -Wall -Werror -O3 -DVERSION=${VERSION} src/opendeco.c src/deco.c src/schedule.c src/output.c -lm -o opendeco
@@ -10,6 +10,14 @@ opendeco: src/opendeco.c src/deco.c src/deco.h src/schedule.c src/schedule.h src
opendeco_test: test/opendeco_test.c test/deco_test.c src/deco.c
gcc --std=c99 -pedantic -Wall -Werror -O3 test/minunit.c test/opendeco_test.c test/deco_test.c src/deco.c -lm -o opendeco_test
+libopendeco.a:
+ gcc -c src/deco.c -o src/deco.o
+ gcc -c src/schedule.c -o src/schedule.o
+ gcc -c src/output.c -o src/output.o
+ ar rs libopendeco.a src/deco.o src/schedule.o src/output.o
+
+lib: libopendeco.a
+
run: opendeco
./opendeco -d 30 -t 120 -g EAN32 --decogasses EAN50
@@ -25,5 +33,7 @@ uninstall:
rm -f ${DESTDIR}${PREFIX}/bin/opendeco
clean:
- rm opendeco
- rm opendeco_test
+ rm -f opendeco
+ rm -f opendeco_test
+ rm -f src/*.o
+ rm -f libopendeco.a