public inbox for ~johnnyrichard/olang-devel@lists.sr.ht
 help / color / mirror / code / Atom feed
0a5c5aa4da85b78d66222c91537ed45538244d64 blob 666 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
SRCS := $(wildcard *.c)
DEP_OBJS := $(filter-out ../../build/main.o, $(wildcard ../../build/*.o))
CFLAGS := -I../../src -I../shared
TESTS := $(patsubst %.c, %.bin, $(SRCS))
RUN_TESTS := $(patsubst %.bin, %.run, $(TESTS))
MUNIT_SRC := ../shared/munit.c
MUNIT := ./munit.o

.PHONY: all clean format format-fix
all: $(RUN_TESTS)

%.bin: %.c $(MUNIT)
	@$(CC) $(CFLAGS) $(MUNIT) $(DEP_OBJS) $< -o $@
	@printf 'CCLD\t%s\n' '$@'

%.run: %.bin
	@./$<

clean:
	@$(RM) *.o *.bin
	@$(RM) -rfv lib

format: $(SRCS)
	@clang-format --dry-run --Werror $?

format-fix: $(SRCS)
	@clang-format -i $?

$(MUNIT):
	@$(CC) -c $(MUNIT_SRC) $(CFLAGS) -o $(MUNIT)
	@printf 'CCLD\t%s\n' '$@'
debug log:

solving 0a5c5aa ...
found 0a5c5aa in https://git.johnnyrichard.com/olang.git

Code repositories for project(s) associated with this public inbox

	https://git.johnnyrichard.com/olang.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox