summaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authordaniel-Jones <daniel@danieljon.es>2018-10-04 20:57:28 +0930
committerdaniel-Jones <daniel@danieljon.es>2018-10-04 20:57:28 +0930
commit3eca5a4f1a5dafa8869987940398af8a3458eb8e (patch)
tree12cf7d2ab625da18d5e74bd74a7950a610d55539 /makefile
downloadcfg-3eca5a4f1a5dafa8869987940398af8a3458eb8e.tar.gz
cfg-3eca5a4f1a5dafa8869987940398af8a3458eb8e.zip
first commit
Diffstat (limited to 'makefile')
-rw-r--r--makefile25
1 files changed, 25 insertions, 0 deletions
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)
+