diff options
Diffstat (limited to 'src/c/hello-c/Makefile')
-rw-r--r-- | src/c/hello-c/Makefile | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/c/hello-c/Makefile b/src/c/hello-c/Makefile new file mode 100644 index 0000000..876f118 --- /dev/null +++ b/src/c/hello-c/Makefile @@ -0,0 +1,30 @@ +# Minimal Makefile to compile hello.c into an executable named main + +# Compiler +CC = gcc + + +# Flags +CFLAGS = -Wall -Wextra -O2 + + +# Default target +# Tells make what dependencies to compile +all: hello + + +# Dependency 'hello' +# hello.c is the source file +hello: hello.c + $(CC) $(CFLAGS) -o hello hello.c + + +# Test target +test: hello + @echo -n "hello.c test............................" + @./hello >/dev/null 2>&1 && echo "OK" || echo "FAILED" + + +# Clean target +clean: + rm -f hello |