diff options
author | Vicente <vicente@masba.net> | 2024-04-02 17:38:25 -0300 |
---|---|---|
committer | Vicente <vicente@masba.net> | 2024-04-02 17:38:25 -0300 |
commit | f5c501f0c151079a7207ee9b06b779b39e17c55e (patch) | |
tree | 0e539f5c74e8df9a4aba89f5a40bb81fabdf104a | |
parent | f84aaa169191ecc2c1ee8f928c6b1b963232bc61 (diff) | |
parent | d735c3c05ea1640aa9134dc58cdad90310d1cc26 (diff) |
Merge remote-tracking branch 'refs/remotes/origin/master'
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 48 | ||||
-rw-r--r-- | main.c | 6 |
3 files changed, 55 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e660fd9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +bin/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2e857bc --- /dev/null +++ b/Makefile @@ -0,0 +1,48 @@ +MKDIR := mkdir +RMDIR := rm -r +RM := rm +CC := gcc +BINDIR := ./bin +TESTDIR := ./test +SRCDIRS := ./ +SRCS := $(foreach fd, $(SRCDIRS), $(wildcard $(fd)/*.c)) +OBJS := $(patsubst %.c,$(BINDIR)/%.o,$(SRCS)) +ARCFIND := $(BINDIR)/arcfind +EXES := $(ARCFIND) +CFLAGS := $(addprefix -I,$(SRCDIRS)) $(XTRAFLAGS) +LDLIBS := + +ARCFIND_O := $(addprefix ./bin/, main.o) + +all: $(EXES) +.PHONY: all + +$(BINDIR)/%.o: %.c | $(BINDIR) + $(CC) $(CFLAGS) -c -o $@ $^ $(LDLIBS) + +include $(DEPS) + +$(ARCFIND): $(ARCFIND_O) | $(BINDIR) + $(CC) $(CFLAGS) -o $@ $^ $(LDLIBS) + +# TODO: one good rule for the test bins + +$(BINDIR): + $(MKDIR) $@ + +$(TESTDIR): + $(MKDIR) $@ + +debug: + $(MAKE) XTRAFLAGS:="-g -fsanitize=undefined -fsanitize-undefined-trap-on-error -fno-omit-frame-pointer -O0 -DDEBUG -Wuninitialized" +.PHONY: debug + +release: + $(MAKE) XTRAFLAGS:="-O3" +.PHONY: release + +clean: + -$(RM) $(OBJS) + -$(RM) $(EXES) +.PHONY: clean + @@ -0,0 +1,6 @@ +#include <stdio.h> + +int main(void) { + printf("arcfind!\n"); + return 0; +} |