Starting to get rid of the C version of things that can be in crystal

This commit is contained in:
2023-07-14 11:58:32 -03:00
parent 3e07ef138a
commit df2c0c147a
3 changed files with 231 additions and 12 deletions

View File

@ -1,17 +1,7 @@
CC=gcc
all: test
shortcodes.c: shortcodes.rl
ragel -G2 shortcodes.rl -o shortcodes.c
tests.so: shortcodes.c tests.c
$(CC) -fPIC -shared -g -o $@ $^ -lbg -lcgreen
clean:
rm -f shortcodes.c *.o *.so tests
test: tests.so
cgreen-runner $^
debug:
cgreen-debug tests.so
rm -f shortcodes.o
%o: %c
$(CC) -g -c -o $@ $^
shortcodes.a: shortcodes.o
ar rcs $@ $^
.PHONY: test debug

View File

@ -1,4 +1,4 @@
@[Link(ldflags: "#{__DIR__}/../shortcodes.o")]
@[Link(ldflags: "#{__DIR__}/shortcodes.o")]
lib Shortcodes
struct Chunk