summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 24 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..2dd9aca
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,24 @@
+include config.mk
+SRC = sm.c util.c ${PLUGINS}
+OBJ = ${SRC:.c=.o}
+
+sm: ${OBJ}
+ ${CC} ${LDFLAGS} -o sm ${OBJ}
+
+.c.o:
+ ${CC} ${CFLAGS} -c $<
+
+${OBJ}: config.h plugins.h
+
+plugins.h: ${PLUGINS}
+ printf '%s\n' ${PLUGINS:.c=} | awk -f genplugin.awk
+
+install:
+ install -dm 0755 ${DESTDIR}${PREFIX}/bin
+ install -m 0755 sm ${DESTDIR}${PREFIX}/bin
+
+uninstall:
+ rm -f ${DESTDIR}${PREFIX}/bin/sm
+
+clean:
+ rm -f sm plugins.h ${OBJ}