mirror of
https://github.com/janet-lang/janet
synced 2024-09-28 23:10:40 +00:00
Update Makefile for faster builds.
This commit is contained in:
parent
ac4b46bdb1
commit
584c75b3f6
16
Makefile
16
Makefile
@ -29,7 +29,7 @@ BINDIR=$(PREFIX)/bin
|
|||||||
# TODO - when api is finalized, only export public symbols instead of using rdynamic
|
# TODO - when api is finalized, only export public symbols instead of using rdynamic
|
||||||
# which exports all symbols.
|
# which exports all symbols.
|
||||||
|
|
||||||
CFLAGS=-std=c99 -Wall -Wextra -Isrc/include -rdynamic -s -O2
|
CFLAGS=-std=c99 -Wall -Wextra -Isrc/include -rdynamic -O2
|
||||||
CLIBS=-lm -ldl
|
CLIBS=-lm -ldl
|
||||||
PREFIX=/usr/local
|
PREFIX=/usr/local
|
||||||
DST_TARGET=dst
|
DST_TARGET=dst
|
||||||
@ -81,17 +81,13 @@ DST_ALL_SOURCES=$(DST_ASM_SOURCES) \
|
|||||||
$(DST_MAINCLIENT_SOURCES) \
|
$(DST_MAINCLIENT_SOURCES) \
|
||||||
$(DST_PARSER_SOURCES)
|
$(DST_PARSER_SOURCES)
|
||||||
|
|
||||||
$(DST_TARGET): $(DST_ALL_SOURCES) $(DST_ALL_HEADERS)
|
DST_ALL_OBJECTS=$(patsubst %.c,%.o,$(DST_ALL_SOURCES))
|
||||||
$(CC) $(CFLAGS) -o $(DST_TARGET) $(DST_ALL_SOURCES) $(CLIBS)
|
|
||||||
|
|
||||||
#######################
|
%.o: %.c $(DST_ALL_HEADERS)
|
||||||
##### C Libraries #####
|
$(CC) $(CFLAGS) -o $@ -c $<
|
||||||
#######################
|
|
||||||
|
|
||||||
# DST_C_LIBS=$(addprefix libs/,testlib.so)
|
$(DST_TARGET): $(DST_ALL_OBJECTS)
|
||||||
|
$(CC) $(CFLAGS) -o $(DST_TARGET) $(DST_ALL_OBJECTS) $(CLIBS)
|
||||||
%.so: %.c $(DST_HEADERS)
|
|
||||||
$(CC) $(CFLAGS) -DDST_LIB -shared -undefined dynamic_lookup -o $@ $<
|
|
||||||
|
|
||||||
###################
|
###################
|
||||||
##### Testing #####
|
##### Testing #####
|
||||||
|
@ -36,13 +36,11 @@ int main(int argc, char **argv) {
|
|||||||
env = dst_stl_env();
|
env = dst_stl_env();
|
||||||
dst_gcroot(dst_wrap_table(env));
|
dst_gcroot(dst_wrap_table(env));
|
||||||
|
|
||||||
/* Create process tuple */
|
/* Create args tuple */
|
||||||
args = dst_array(argc);
|
args = dst_array(argc);
|
||||||
for (i = 0; i < argc; i++) {
|
for (i = 0; i < argc; i++) {
|
||||||
dst_array_push(args, dst_cstringv(argv[i]));
|
dst_array_push(args, dst_cstringv(argv[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Allow access to runtime argument */
|
|
||||||
dst_env_def(env, "args", dst_wrap_array(args));
|
dst_env_def(env, "args", dst_wrap_array(args));
|
||||||
|
|
||||||
/* Expose line getter */
|
/* Expose line getter */
|
||||||
|
Loading…
Reference in New Issue
Block a user