aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2017-07-17 00:24:27 +0200
committerache <ache@ache.one>2017-07-17 00:24:27 +0200
commit7f2285ecf11addba41304e7a3ce3b5d0648ea4b4 (patch)
tree1aae94af518cf3dddfd4966a5fb8217330f7440a
parentNew main (diff)
Use a makefile
-rw-r--r--Makefile40
1 files changed, 40 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..a4a9ea4
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,40 @@
+
+
+CC=gcc
+PROG=metag
+LIBS=-lcurses -ltag_c -lreadline
+HEADERS=$(wildcard *.h)
+FILES=basic_curses.c item.c readline.c regex.c wind.c
+OBJ_FILES := $(FILES:.c=.o)
+CFLAGS+=-std=gnu99
+
+
+all: $(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 $(OBJ_FILES)
+
+mrproper: clean
+ rm ./$(PROG)
+
+
+install: todo
+ [ -e /usr/bin/$(PROG) ] && sudo cp $(PROG) /usr/bin/$(PROG)
+ echo 'Installation success'
+
+uninstall: /usr/bin/$(PROG)
+ rm /usr/bin/$(PROG)
+