4 CPPFLAGS
+= -I..
-I..
/..
-I..
/..
/.. \
5 -I..
/external_libs
/libffi
/include \
6 -I..
/external_libs
/libev \
7 -I..
/external_libs
/onig \
8 -I..
/external_libs
/libgdtoa \
9 -I..
/external_libs
/libtommath \
10 -I..
/external_libs
/libltdl \
11 -I..
/external_libs
/libbstring \
12 -I..
/external_libs
/libcchash \
13 -I..
/external_libs
/libmpa \
14 -I..
/external_libs
/libmquark \
18 ..
/external_libs
/libffi
/.libs
/libffi.a \
19 ..
/external_libs
/libgdtoa
/libgdtoa.a \
20 ..
/external_libs
/libtommath
/libtommath.a \
21 ..
/external_libs
/onig
/.libs
/libonig.a \
23 ..
/external_libs
/libev
/.libs
/libev.a \
24 ..
/external_libs
/libltdl
/.libs
/libltdl.a \
26 ..
/external_libs
/libbstring
/libbstring.a \
27 ..
/external_libs
/libcchash
/libcchash.a \
28 ..
/external_libs
/libmpa
/libptr_array.a \
29 ..
/external_libs
/libmquark
/libmquark.a
32 CPPFLAGS
+= -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS
=64
35 ifeq ($(UNAME
),Darwin
)
36 CPPFLAGS
+= -D_XOPEN_SOURCE
-D_DARWIN_USE_64_BIT_INODE
37 SINGLE_MODULE
=-Wl
,-single_module
42 ifneq ($(findstring BSD
,$(UNAME
)),BSD
)
43 # BSD do not require a separate libdl
46 # BSD and Darwin comes with strlcat and strlcpy
47 CPPFLAGS
+=-DHAVE_STRLCAT
-DHAVE_STRLCPY
48 CPPFLAGS
+=-I
/usr
/local
/include
51 ifeq ($(UNAME
),Darwin
)
52 # BSD and Darwin comes with strlcat and strlcpy
53 CPPFLAGS
+=-DHAVE_STRLCAT
-DHAVE_STRLCPY
56 # Linux needs -lrt and -lcrypt
57 # FreeBSD only needs -lcrypt
58 # Darwin, OpenBSD and Solaris don't need any
63 ifeq ($(UNAME
),FreeBSD
)
67 # BSD needs special PThread handling
68 ifeq ($(findstring BSD
,$(UNAME
)),BSD
)
73 CFLAGS
+=-D__C99FEATURES__
84 OPTIMIZATIONS
=-O3
-falign-loops
-momit-leaf-frame-pointer
-fno-tree-pre
86 OPTIMIZATIONS
=-O2
-finline-functions
91 ifeq ($(CPU
), powerpc
)
92 OPTIMIZATIONS
+=-falign-loops
=16
95 CFLAGS
+= -fPIC
$(CPPFLAGS
)
96 DEPS
=auto.h system_primitives.gen instruction_names.c instruction_names.h \
97 node_types.c node_types.h
101 $(wildcard subtend
/*.c
) \
104 instruction_names.c \
107 OBJS
=$(SOURCES
:.c
=.o
) subtend
/PortableUContext_asm.o
109 # Explicitly require anything you need from kernel/ or lib/
113 $(COMP
) $(CFLAGS
) $(OPTIMIZATIONS
) -c
$< -o
$@
116 $(COMP
) $(CFLAGS
) $(OPTIMIZATIONS
) -c
$< -o
$@
121 $(CC
) -MM
-MT
'$(<:.c=.o)' $(CPPFLAGS
) $< > $@.
$$$$; \
122 sed
's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.
$$$$ > $@
; \
125 $(RBXLIB
): $(RBXLIBLOCAL
)
126 $(LINKER
) -o
$(RBXLIB
) $(OBJS
) $(SONAME
) $(LIBS
)
128 $(RBXLIBLOCAL
): $(DEPS
) $(OBJS
)
129 $(LINKER
) -o
$(RBXLIBLOCAL
) $(OBJS
) $(SONAMELOCAL
) $(LIBS
)
135 cpu_instructions.o
: instructions.gen instruction_names.c instruction_names.h
136 cpu_primitives.o
: system_primitives.gen
137 object_memory.o
: object_memory.h
139 instruction_names.c instruction_names.h instructions.gen
: instructions.rb
140 $(RUBY
) instructions.rb
> instructions.gen
142 system_primitives.gen
: primitives.rb
143 $(RUBY
) primitives.rb
> system_primitives.gen
145 auto.h auto.c
: genheader.rb ..
/..
/lib
/compiler
/system_hints.rb
146 $(RUBY
) genheader.rb
> auto.c
148 node_types.c node_types.h
: node_types.rb
149 $(RUBY
) node_types.rb
152 $(COMP
) $(CFLAGS
) -c grammar.c
154 subtend
/ffi.o
: subtend
/ffi.c
155 $(COMP
) $(CFLAGS
) $(OPTIMIZATIONS
) -Wno-unused-variable
-Wno-unused-value
-c
$< -o
$@
157 # In a perfect world, we'd only rebuild grammar.c if grammar.y changed.
158 # However, version control systems do not track file modify times, which will
159 # mess up make's dependency tracking. So don't depend on grammar.y here.
161 bison
-o grammar.c grammar.y
177 instruction_names.c \
178 instruction_names.h \
181 primitive_indexes.h \
191 ifneq ($(MAKECMDGOALS
),clean)
192 -include $(SOURCES
:%.c
=%.d
)