Simplified condtions on Makefile.

This commit is contained in:
Neil 2022-12-27 15:19:10 -08:00
parent b73194d47d
commit 67fdb651e5
4 changed files with 16 additions and 4 deletions

View File

@ -29,14 +29,15 @@ else
CF += -g
endif
projects := bin/text bin/kjv
projects := bin/test-text bin/test-kjv
#docs := $(patsubst test/test_%.c, doc/%.md, $(wildcard test/test_*.c))
default: $(projects)
# success
bin/text: build/text.o build/test_text.o
bin/kjv: build/text.o build/kjv.o build/test_kjv.o
bin/test-text: build/test_text.o build/text.o
bin/test-kjv: build/test_kjv.o build/text.o build/kjv.o
bin/test-journal: build/test_journal.o
bin/%:
# linking test $@
@ -57,7 +58,7 @@ build/%.o: build/%.c
# compile generated $@
$(CC) $(CF) -c -o $@ $<
build/%.c: src/%.re_c.c
build/%.c: src/%.re.c
# https://re2c.org/ generate $@
@mkdir -p build
re2c -W --tags --conditions -o $@ $<
@ -66,6 +67,7 @@ build/%.c: src/%.re_c.c
# # https://github.com/neil-edelman/cdoc documentation
# -cdoc -o $@ $<
.SECONDARY: build/kjv.c
.PHONY: clean release test
test: $(projects)

10
test/test_journal.c Normal file
View File

@ -0,0 +1,10 @@
#include "../src/kjv.h"
#include <stdio.h>
#include <inttypes.h> /* C99 */
#include <stdlib.h>
#include <assert.h>
int main(void) {
printf("Hello, World!\n");
return 0;
}