aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorache <ache@ache.one>2017-11-08 03:49:10 +0100
committerache <ache@ache.one>2017-11-08 03:49:10 +0100
commit28a3fa7afebb9937fa42b9d53678eb8fd0be529d (patch)
tree83e5caf6ce15aed1cfc1145f1bea91722b67ec9b /Makefile
Init commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile43
1 files changed, 43 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..17c5f37
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,43 @@
+
+
+CC=gcc
+PROG=mesms
+LIBS=-lcurses -lreadline
+HEADERS=$(wildcard *.h)
+FILES=readline.c wind.c
+OBJ_FILES := $(FILES:.c=.o)
+CFLAGS+=-std=gnu99
+
+
+all: $(PROG)
+
+debug: CFLAGS += -DDEBUG -g
+debug: $(PROG)
+
+$(PROG): main.c main.h $(OBJ_FILES)
+ $(CC) $(CFLAGS) $(LIBS) -o $@ main.c $(OBJ_FILES)
+
+
+
+
+%.o: %.c $(HEADERS)
+ $(CC) $(CFLAGS) $(LIBS) -c -o $@ $<
+
+
+
+.PHONY: clean mrproper
+
+clean:
+ rm -f $(OBJ_FILES)
+
+mrproper: clean
+ rm -f ./$(PROG)
+
+
+install: $(PROG)
+ cp $(PROG) /usr/bin/$(PROG)
+ @echo 'Installation success'
+
+uninstall: /usr/bin/$(PROG)
+ rm -f /usr/bin/$(PROG)
+