From 068d6963a18bcbd7a641022e9f444e936ff5bc4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikael=20L=C3=B6vqvist?= Date: Thu, 5 Mar 2026 20:09:45 +0100 Subject: [PATCH] Added build dir, and gitignore --- .gitignore | 1 + Makefile | 15 +++++++++------ test/lib/setup.mjs | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d163863 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build/ \ No newline at end of file diff --git a/Makefile b/Makefile index c5d95f8..4b150fc 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,17 @@ -SHELL := /bin/bash -CC := cc -CFLAGS := -Wall -O2 -TARGET := fa2json -SRCS := fs-watcher.c json-writer.c +SHELL := /bin/bash +CC := cc +MKDIR := mkdir +CFLAGS := -Wall -Werror -Os +BUILD_DIR := build +TARGET := $(BUILD_DIR)/fa2json +SRCS := fs-watcher.c json-writer.c .PHONY: all test dev clean all: $(TARGET) $(TARGET): $(SRCS) + $(MKDIR) -p $(BUILD_DIR) $(CC) $(CFLAGS) -o $@ $^ test: $(TARGET) @@ -18,4 +21,4 @@ dev: $(TARGET) node test/dev.mjs $(ARGS) clean: - rm -f $(TARGET) + rm -rf $(BUILD_DIR) diff --git a/test/lib/setup.mjs b/test/lib/setup.mjs index 2888f62..4b622f8 100644 --- a/test/lib/setup.mjs +++ b/test/lib/setup.mjs @@ -3,7 +3,7 @@ import { mkdtempSync, mkdirSync } from 'node:fs'; import { tmpdir } from 'node:os'; import { join } from 'node:path'; -const FA2JSON = new URL('../../fa2json', import.meta.url).pathname; +const FA2JSON = new URL('../../build/fa2json', import.meta.url).pathname; export async function setup() { // Create image file and format