diff options
author | ache <ache@ache.one> | 2017-07-17 00:24:27 +0200 |
---|---|---|
committer | ache <ache@ache.one> | 2017-07-17 00:24:27 +0200 |
commit | 7f2285ecf11addba41304e7a3ce3b5d0648ea4b4 (patch) | |
tree | 1aae94af518cf3dddfd4966a5fb8217330f7440a | |
parent | New main (diff) |
Use a makefile
-rw-r--r-- | Makefile | 40 |
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) + |