+
CC=gcc
+CFLAGS=-g -Wall -Wno-unused-variable -Wno-unused-but-set-variable -Wno-switch
+LIBS=-ltinfo -lncurses -lmd4c
make: taskasaur
all: taskasaur
-parser.o: parser.c headers/parser.h
- $(CC) -c parser.c
-
-render.o: render.c headers/render.h
- $(CC) -c render.c
-
-menu.o: menu.c headers/menu.h
- $(CC) -c menu.c
-
-utils.o: utils.c headers/utils.h
- $(CC) -c utils.c
-
-# include config.h as depend
+%.o: %.c headers/%.h config.h
+ $(CC) $(CFLAGS) -c $< $(LIBS)
-taskasaur: taskasaur.c parser.o render.o menu.o utils.o config.h
- $(CC) -o $@ $^ -lncurses -lmd4c
+taskasaur: taskasaur.c menu.o parser.o render.o utils.o
+ $(CC) $(CFLAGS) -o $@ $^ $(LIBS)
clean:
rm taskasaur *.o