aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorVictor Mignot <victor@vmignot.fr>2026-02-18 08:16:09 +0100
committerVictor Mignot <victor@vmignot.fr>2026-03-09 19:52:47 +0100
commitc856ca9339e7154699a8ac81ec943d45d8c5ffe8 (patch)
treee5cd54cd3df53dc84e8d755a64e31f52c464e9d5 /Makefile
downloadfutiles-c856ca9339e7154699a8ac81ec943d45d8c5ffe8.tar.gz
Implement `true` and `false`
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile28
1 files changed, 28 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..c8010d2
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,28 @@
+CC := gcc
+CFLAGS :=
+CFLAGS_EXTRA := -std=c23 -Wpedantic -Wall -Wextra
+LDFLAGS :=
+PREFIX :=
+UTILS := true false
+
+BIN := futiles
+OBJS := $(patsubst %.c, %.o, $(wildcard src/*.c))
+
+all: $(BIN)
+
+$(BIN): $(OBJS)
+ $(CC) -o $@ $(CFLAGS) $(CFLAGS_EXTRA) $(LDFLAGS) $^
+
+src/%.o: src/%.c
+ $(CC) -c -o $@ $(CFLAGS) $(CFLAGS_EXTRA) $<
+
+clean:
+ rm -f $(BIN) $(OBJS)
+
+install: $(BIN)
+ install -m 755 $(BIN) $(PREFIX)/bin/
+ for util in $(UTILS) ; do \
+ ln -sf futiles /usr/bin/$$util; \
+ done
+
+.PHONY: clean install