From e5931c0a4146b006c7b71001c49e977af1674553 Mon Sep 17 00:00:00 2001 From: anthraxx Date: Tue, 10 Jun 2014 14:40:54 +0200 Subject: [PATCH] adding simple makefile to build door challenge --- .gitignore | 3 ++- Makefile | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index f47cb20..bebb0b7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -*.out +/challenge/*.o +/doorchallenge diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..465fd0d --- /dev/null +++ b/Makefile @@ -0,0 +1,27 @@ +TARGET=doorchallenge + +CC:=gcc +LD:=$(CC) + +LDLIBS= +LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro +CFLAGS=-Wall \ + -Wextra \ + -Winit-self \ + -Wuninitialized \ + -Wfloat-equal \ + -Wint-to-pointer-cast \ + -pedantic \ + -O2 \ + -fstack-protector-strong + +all: $(TARGET) + +$(TARGET): challenge/challenge.o + $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS) + +challenge/%.o: challenge/%.c + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + $(RM) -rf challenge/*.o $(TARGET)