public inbox for ~johnnyrichard/olang-devel@lists.sr.ht
 help / color / mirror / code / Atom feed
7c6a8b385001ea8d4edb04c637bbf2f36a5a00ff blob 800 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
32
33
 
SRCS         := $(wildcard *_test.c)
OBJS         := $(patsubst %_test.c, %_test.o, $(SRCS))
SUBJECT_OBJS := $(filter-out ../../build/0c.o, $(wildcard ../../build/*.o))
CFLAGS       := -I../../src -I../shared
TESTS        := $(patsubst %_test.c, %_test, $(SRCS))
EXEC_TESTS   := $(patsubst %_test, ./%_test, $(TESTS))
MUNIT_SRC    := ../shared/munit.c
MUNIT        := ./munit.o

.PHONY: all
all: $(MUNIT) $(TESTS)
	@for file in $(EXEC_TESTS); do \
                ./"$$file"; \
        done

.PHONY: clean
clean:
	$(RM) *.o *_test
	$(RM) -rfv lib

.PHONY: linter
linter: $(SRCS)
	clang-format --dry-run --Werror $?

.PHONY: linter-fix
linter-fix: $(SRCS)
	clang-format -i $?

%_test: $(MUNIT) $(SUBJECT_OBJS) %_test.c
	$(CC) $? $(CFLAGS) -o $@

$(MUNIT):
	$(CC) -c $(MUNIT_SRC) $(CFLAGS) -o $(MUNIT)
debug log:

solving 7c6a8b3 ...
found 7c6a8b3 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