1
0
mirror of https://github.com/janet-lang/janet synced 2024-06-19 11:49:56 +00:00

Update Makefile for faster builds.

This commit is contained in:
Calvin Rose 2018-05-10 11:11:18 -04:00
parent ac4b46bdb1
commit 584c75b3f6
2 changed files with 7 additions and 13 deletions

View File

@ -29,7 +29,7 @@ BINDIR=$(PREFIX)/bin
# TODO - when api is finalized, only export public symbols instead of using rdynamic
# 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
PREFIX=/usr/local
DST_TARGET=dst
@ -81,17 +81,13 @@ DST_ALL_SOURCES=$(DST_ASM_SOURCES) \
$(DST_MAINCLIENT_SOURCES) \
$(DST_PARSER_SOURCES)
$(DST_TARGET): $(DST_ALL_SOURCES) $(DST_ALL_HEADERS)
$(CC) $(CFLAGS) -o $(DST_TARGET) $(DST_ALL_SOURCES) $(CLIBS)
DST_ALL_OBJECTS=$(patsubst %.c,%.o,$(DST_ALL_SOURCES))
#######################
##### C Libraries #####
#######################
%.o: %.c $(DST_ALL_HEADERS)
$(CC) $(CFLAGS) -o $@ -c $<
# DST_C_LIBS=$(addprefix libs/,testlib.so)
%.so: %.c $(DST_HEADERS)
$(CC) $(CFLAGS) -DDST_LIB -shared -undefined dynamic_lookup -o $@ $<
$(DST_TARGET): $(DST_ALL_OBJECTS)
$(CC) $(CFLAGS) -o $(DST_TARGET) $(DST_ALL_OBJECTS) $(CLIBS)
###################
##### Testing #####

View File

@ -36,13 +36,11 @@ int main(int argc, char **argv) {
env = dst_stl_env();
dst_gcroot(dst_wrap_table(env));
/* Create process tuple */
/* Create args tuple */
args = dst_array(argc);
for (i = 0; i < argc; i++) {
dst_array_push(args, dst_cstringv(argv[i]));
}
/* Allow access to runtime argument */
dst_env_def(env, "args", dst_wrap_array(args));
/* Expose line getter */