From 012bf15d20fac68da3f494c41a22bea4e389b884 Mon Sep 17 00:00:00 2001 From: TazyFoundSoup Date: Sun, 22 Feb 2026 09:21:56 +1100 Subject: feat(makefile): Add makefile and compile_commands.json --- Makefile | 21 ++++++++++++++ compile_commands.json | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 Makefile create mode 100644 compile_commands.json diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4ba7959 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +CC=gcc +AR=ar +CFLAGS=-Wall -Wextra -std=c11 -O2 -Iinclude -Iinclude/tinyff -Iinclude/ext + +SRC=$(shell find src -name "*.c") +OBJ=$(SRC:.c=.o) + +LIB=libtinyff.a + +all: $(LIB) + +$(LIB): $(OBJ) + $(AR) rcs $(LIB) $(OBJ) + +%.o: %.c + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -f $(OBJ) $(LIB) + +.PHONY: all clean diff --git a/compile_commands.json b/compile_commands.json new file mode 100644 index 0000000..3e3c90f --- /dev/null +++ b/compile_commands.json @@ -0,0 +1,78 @@ +[ + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-std=c11", + "-O2", + "-Iinclude", + "-Iinclude/tinyff", + "-Iinclude/ext", + "-c", + "-o", + "src/common.o", + "src/common.c" + ], + "directory": "/home/watson/tinyff", + "file": "/home/watson/tinyff/src/common.c", + "output": "/home/watson/tinyff/src/common.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-std=c11", + "-O2", + "-Iinclude", + "-Iinclude/tinyff", + "-Iinclude/ext", + "-c", + "-o", + "src/stream.o", + "src/stream.c" + ], + "directory": "/home/watson/tinyff", + "file": "/home/watson/tinyff/src/stream.c", + "output": "/home/watson/tinyff/src/stream.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-std=c11", + "-O2", + "-Iinclude", + "-Iinclude/tinyff", + "-Iinclude/ext", + "-c", + "-o", + "src/dbg.o", + "src/dbg.c" + ], + "directory": "/home/watson/tinyff", + "file": "/home/watson/tinyff/src/dbg.c", + "output": "/home/watson/tinyff/src/dbg.o" + }, + { + "arguments": [ + "/usr/bin/gcc", + "-Wall", + "-Wextra", + "-std=c11", + "-O2", + "-Iinclude", + "-Iinclude/tinyff", + "-Iinclude/ext", + "-c", + "-o", + "src/format/image/bmp.o", + "src/format/image/bmp.c" + ], + "directory": "/home/watson/tinyff", + "file": "/home/watson/tinyff/src/format/image/bmp.c", + "output": "/home/watson/tinyff/src/format/image/bmp.o" + } +] -- cgit v1.2.3