summaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authorDaniel Jones <admin@danieljon.es>2020-11-19 23:49:25 +1030
committerDaniel Jones <admin@danieljon.es>2020-11-19 23:49:25 +1030
commit8cabdb9b7bc682949bcad2e90055a485aafad7a3 (patch)
treea755a2bbc138e4fd826858fb4cc8059040ecd722 /makefile
downloadbrainfuck-8cabdb9b7bc682949bcad2e90055a485aafad7a3.tar.gz
brainfuck-8cabdb9b7bc682949bcad2e90055a485aafad7a3.zip
interpreter works
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..7b21de5
--- /dev/null
+++ b/makefile
@@ -0,0 +1,25 @@
+TARGET = brainfuck
+LIBS =
+CC = gcc
+CFLAGS = -std=c99 -g -Wextra -Wall -Werror -Wno-unused-variable -Wimplicit-fallthrough
+
+.PHONY: default all
+
+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 $(CFLAGS) $(LIBS) -o $@
+
+clean:
+ -rm -f *.o
+ -rm -f *.tmp
+ -rm -f $(TARGET)