From 7aefdcdc7ff908248c6aa36b07d2313d7962772c Mon Sep 17 00:00:00 2001 From: Lexi Quinn Date: Wed, 11 Aug 2021 23:50:59 +1000 Subject: [PATCH] initial helloworld --- Makefile | 24 ++++++++++++++++++++++++ timer.c | 7 +++++++ 2 files changed, 31 insertions(+) create mode 100644 Makefile create mode 100644 timer.c diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f6d7900 --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +TARGET = qtimer +LIBS = -lm +CC = gcc +CFLAGS = -g -Wall + +.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) diff --git a/timer.c b/timer.c new file mode 100644 index 0000000..2137eca --- /dev/null +++ b/timer.c @@ -0,0 +1,7 @@ +#include + +int main(char argc, char** argv) +{ + printf("Hello, World!\n"); + return 0; +}