public inbox for ~johnnyrichard/olang-devel@lists.sr.ht
 help / color / mirror / code / Atom feed
686938f9207703da2121fd1444e924e088aa51dd blob 610 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
 
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 $@

%.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)
debug log:

solving 686938f ...
found 686938f 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