summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorTyler Murphy <tylerm@tylerm.dev>2023-04-22 00:48:41 -0400
committerTyler Murphy <tylerm@tylerm.dev>2023-04-22 00:48:41 -0400
commitb0613d87eb19532de28e5b6021271221a89873ff (patch)
treebd4bc8bdccee2dafe61e182a5a0fec84c8835459 /Makefile
downloadritfetch-b0613d87eb19532de28e5b6021271221a89873ff.tar.gz
ritfetch-b0613d87eb19532de28e5b6021271221a89873ff.tar.bz2
ritfetch-b0613d87eb19532de28e5b6021271221a89873ff.zip
initial
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile40
1 files changed, 40 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..45e10d2
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,40 @@
+CC = gcc
+
+INCFLAGS = -Isrc
+
+CCFLAGS = -std=gnu99 -Wall -Wextra -pedantic -O2
+CCFLAGS += $(INCFLAGS)
+
+LDFLAGS += $(INCFLAGS)
+
+BIN = bin
+APP = $(BIN)/app
+SRC = $(shell find src -name "*.c")
+OBJ = $(SRC:%.c=$(BIN)/%.o)
+
+.PHONY: dirs run clean build install uninstall
+
+EOF: 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/ritfetch
+
+uninstall:
+ rm /usr/local/bin/ritfetch