summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorAriadna Vigo <arivigodr@gmail.com>2020-06-19 16:03:23 +0200
committerAriadna Vigo <arivigodr@gmail.com>2020-06-19 16:03:23 +0200
commit68a2b8706a41273b27dc3cfefbafd2c19dba7645 (patch)
treed632a5e09b8b0f360d478e46c46fb194995f9d6c /Makefile
Initial commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile37
1 files changed, 37 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..0868099
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,37 @@
+# See LICENSE file for copyright and license details.
+
+.POSIX:
+
+include config.mk
+
+SRC = cras.c tasklst.c
+OBJ = ${SRC:%.c=%.o}
+
+all: options cras
+
+options:
+ @echo Build options:
+ @echo "CFLAGS = ${CFLAGS}"
+ @echo "LDFLAGS = ${LDFLAGS}"
+ @echo "CC = ${CC}"
+
+.c.o:
+ ${CC} -c ${CFLAGS} $<
+
+${OBJ}: config.mk
+
+cras: ${OBJ}
+ ${CC} -o $@ ${OBJ} ${LDFLAGS}
+
+clean:
+ rm -f cras ${OBJ}
+
+install: all
+ mkdir -p ${DESTDIR}${PREFIX}/bin
+ cp -f cras ${DESTDIR}${PREFIX}/bin
+ chmod 755 ${DESTDIR}${PREFIX}/bin/cras
+
+uninstall:
+ rm -f ${DESTDIR}${PREFIX}/bin/cras
+
+.PHONY: all options clean install uninstall