From 3a8f8c7318d7a664684ceb5b7b2c2c9ed0b82087 Mon Sep 17 00:00:00 2001 From: Daniel Jones Date: Sun, 8 Dec 2019 22:53:47 +1030 Subject: add generic make file --- makefile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 makefile diff --git a/makefile b/makefile new file mode 100644 index 0000000..8005ab8 --- /dev/null +++ b/makefile @@ -0,0 +1,25 @@ +TARGET = binstatus +LIBS = -lX11 +CC = gcc +CFLAGS = -g -Wall -Werror + +.PHONY: default all clean + +default: $(TARGET) +all: default + +OBJECTS = $(patsubst %.c, %.o, $(wildcard *.c)) +HEADERS = $(wildcard *.h) + +%.o: %.c $(HEADERS) + $(CC) $(CFLAGS) -c $< -o $@ + +.PRECIOUS: $(TARGET) $(OBJECTS) + +$(TARGET): $(OBJECTS) + $(CC) $(OBJECTS) -Wall $(LIBS) -o $@ + +clean: + -rm -f *.o + -rm -f $(TARGET) + -- cgit v1.2.3