Skip to content
Newer
Older
100644 56 lines (40 sloc) 1.37 KB
47ff91c @macournoyer Build libgc from Makefile.
macournoyer authored
1 CC = gcc
0bd2c24 @singpolyma Switch to getopt and freegetopt.
authored
2 CFLAGS = -std=c99 -pedantic -Wall -Wextra -D_XOPEN_SOURCE -DDEBUG -g -O2 -funroll-loops -fomit-frame-pointer -fstrict-aliasing
3 INCS = -Ivm -Ivendor/gc/build/include -Ivendor
4 LIBS = ${GC} ${FREEGETOPT}
3589e96 @macournoyer Update TODO and add new files for upcoming new classes.
macournoyer authored
5 GC = vendor/gc/build/lib/libgc.a
0d66721 @macournoyer Remove Lemon grammar and Ragel lexer to replace w/ leg grammar.
macournoyer authored
6 LEG = vendor/peg/leg
0bd2c24 @singpolyma Switch to getopt and freegetopt.
authored
7 FREEGETOPT = vendor/freegetopt/getopt.o
0f93cd1 @macournoyer Setup makefile
macournoyer authored
8
2a61ad3 @macournoyer Move block stuff in block.c.
macournoyer authored
9 SRC = vm/string.c vm/number.c vm/range.c vm/primitive.c vm/proc.c vm/array.c vm/hash.c vm/class.c vm/kernel.c vm/object.c vm/block.c vm/compiler.c vm/grammar.c vm/vm.c vm/tr.c
cca0ba2 @macournoyer Make basekit and garbagecollector build.
macournoyer authored
10 OBJ = ${SRC:.c=.o}
11 OBJ_MIN = vm/tr.o
12
0f93cd1 @macournoyer Setup makefile
macournoyer authored
13 all: tinyrb
14
15 .c.o:
c3e5b8c @macournoyer Implement method argument passing.
macournoyer authored
16 @echo " cc $<"
17 @${CC} -c ${CFLAGS} ${INCS} -o $@ $<
0f93cd1 @macournoyer Setup makefile
macournoyer authored
18
cca0ba2 @macournoyer Make basekit and garbagecollector build.
macournoyer authored
19 tinyrb: ${LIBS} ${OBJ}
c3e5b8c @macournoyer Implement method argument passing.
macournoyer authored
20 @${CC} ${CFLAGS} ${OBJ_POTION} ${OBJ} ${LIBS} -o tinyrb
0f93cd1 @macournoyer Setup makefile
macournoyer authored
21
0d66721 @macournoyer Remove Lemon grammar and Ragel lexer to replace w/ leg grammar.
macournoyer authored
22 vm/grammar.c: ${LEG} vm/grammar.leg
23 @echo " leg vm/grammar.leg"
24 @${LEG} -ovm/grammar.c vm/grammar.leg
0f93cd1 @macournoyer Setup makefile
macournoyer authored
25
0bd2c24 @singpolyma Switch to getopt and freegetopt.
authored
26 ${FREEGETOPT}:
27
0d66721 @macournoyer Remove Lemon grammar and Ragel lexer to replace w/ leg grammar.
macournoyer authored
28 ${LEG}:
29 @echo " make peg/leg"
30 @cd vendor/peg && make -s
1553844 @macournoyer Lookup moved to Object.
macournoyer authored
31
47ff91c @macournoyer Build libgc from Makefile.
macournoyer authored
32 ${GC}:
33 @echo " make gc"
34 @cd vendor/gc && ./configure --prefix=`pwd`/build --disable-threads -q && make -s && make install -s
35
0bd40ab @macournoyer Add CLI and smoke tests
macournoyer authored
36 test: tinyrb
37 @ruby test/runner
38
1553844 @macournoyer Lookup moved to Object.
macournoyer authored
39 sloc: clean
0d66721 @macournoyer Remove Lemon grammar and Ragel lexer to replace w/ leg grammar.
macournoyer authored
40 @cp vm/grammar.leg vm/grammar.leg.c
e34e30e @macournoyer Update TODO w/ more focused goals
macournoyer authored
41 @sloccount vm lib
0d66721 @macournoyer Remove Lemon grammar and Ragel lexer to replace w/ leg grammar.
macournoyer authored
42 @rm vm/grammar.leg.c
1553844 @macournoyer Lookup moved to Object.
macournoyer authored
43
44 size: clean
0d66721 @macournoyer Remove Lemon grammar and Ragel lexer to replace w/ leg grammar.
macournoyer authored
45 @ruby -e 'puts "%0.2fK" % (Dir["vm/*.{c,leg,h}"].inject(0) {|s,f| s += File.size(f)} / 1024.0)'
0f93cd1 @macournoyer Setup makefile
macournoyer authored
46
47 clean:
0bd2c24 @singpolyma Switch to getopt and freegetopt.
authored
48 $(RM) vm/*.o vm/grammar.c
0f93cd1 @macournoyer Setup makefile
macournoyer authored
49
ebfe71b @macournoyer Add basic opcode structure.
macournoyer authored
50 rebuild: clean tinyrb
1553844 @macournoyer Lookup moved to Object.
macournoyer authored
51
8438810 @macournoyer Add website
macournoyer authored
52 site:
53 scp site/* macournoyer@code.macournoyer.com:code.macournoyer.com/tinyrb
54
55 .PHONY: all sloc size clean rebuild test site
Something went wrong with that request. Please try again.