by akkartik · 12y ago · 0 comments
$ git clone https://github.com/tekknolagi/carp
$ make
$ ./carp
$ ./carp --help # after peeking in carp.c
help msg
There's a tantalizing target called 'tests' in the Makefile, but it doesn't work.There's some examples, but no makefile to build them. How do you run them?
I see you used to have some .carp files but you just deleted them: https://github.com/tekknolagi/carp/commit/fa16eeb443
I tried restoring one, but it doesn't work:
$ git checkout fa16eeb443~1 examples/reg.carp
$ ./carp -f examples/reg.carp
Unknown label <add>
So at this point I'm ready to give up..You run the examples like so: carp -f examples/carp/call.carp
You can compile C files that use the Carp API, but I have not written any documentation yet.
Check out http://github.com/tekknolagi/gecho — shudder
$ ./carp -f examples/carp/call.carp
Unknown label <add>
(I am very interested in building easy-to-understand codebases: http://akkartik.name/post/wart)Try rebuilding carp? o.O
That was some very nice documentation!
Edit: I just noticed you changed the target (why?) and are also immediately deleting carp.out. So I was indeed using the stale version in spite of using 'make clean' :)
Anyways, so I did this, but still no luck.
$ git diff
diff --git a/Makefile b/Makefile
index f921d96..7c55b4e 100644
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,6 @@ all:
$(CC) $(CFLAGS) $(SRCS)
ar cr libcarp.a $(OBJS)
$(CC) src/carp.c libcarp.a -o $(PROG)
- make clean_objs
#.PHONY: tests
$ make
gcc -c -std=c99 -Wall -Werror -Wno-unused-variable -Wno-format-security -O3 -static src/carp_instructions.c src/carp_lexer.c src/carp_machine.c src/carp_tokenizer.c src/lib/carp_stack.c src/lib/carp_ht.c
ar cr libcarp.a *.o
gcc src/carp.c libcarp.a -o carp.out
$ ./carp.out -f reg.carp
Unknown label <add>