From 27d1594517a3d242c5db411fc2f3216c3fc8dec1 Mon Sep 17 00:00:00 2001 From: daniel-Jones Date: Sun, 14 Oct 2018 13:23:58 +1030 Subject: first code push --- makefile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 makefile (limited to 'makefile') diff --git a/makefile b/makefile new file mode 100644 index 0000000..ecb68ed --- /dev/null +++ b/makefile @@ -0,0 +1,25 @@ +TARGET = example +LIBS = +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