summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorTyler Murphy <tylerm@tylerm.dev>2023-04-13 17:04:05 -0400
committerTyler Murphy <tylerm@tylerm.dev>2023-04-13 17:04:05 -0400
commitfafd290ed990aa2bef34b44fe373175eb6133093 (patch)
tree5d4848b3006bc4eec5d5f49d6372516e1a2a0ba3 /Makefile
downloadbrainfucked-fafd290ed990aa2bef34b44fe373175eb6133093.tar.gz
brainfucked-fafd290ed990aa2bef34b44fe373175eb6133093.tar.bz2
brainfucked-fafd290ed990aa2bef34b44fe373175eb6133093.zip
brainfucked
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile39
1 files changed, 39 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..0e0e8e8
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,39 @@
+CC = gcc
+
+INCFLAGS = -Isrc
+
+CCFLAGS = -std=c99 -Wall -Wextra -pedantic -O2
+CCFLAGS += $(INCFLAGS)
+
+LDFLAGS += $(INCFLAGS)
+LDFLAGS += -lpthread
+
+BIN = bin
+APP = $(BIN)/app
+SRC = $(shell find src -name "*.c")
+OBJ = $(SRC:%.c=$(BIN)/%.o)
+
+.PHONY: clean build
+
+dirs:
+ mkdir -p ./$(BIN)
+ mkdir -p ./$(BIN)/src
+
+run: build
+ $(APP)
+
+build: dirs ${OBJ}
+ ${CC} -o $(APP) $(filter %.o,$^) $(LDFLAGS)
+
+$(BIN)/%.o: %.c
+ $(CC) -o $@ -c $< $(CCFLAGS)
+
+clean:
+ rm -rf $(APP)
+ rm -rf $(BIN)
+
+install:
+ cp $(APP) /usr/local/bin/brainfucked
+
+uninstall:
+ rm /usr/local/bin/brainfucked