fix build
This commit is contained in:
parent
81dd765d8d
commit
4c376650ca
9
Makefile
9
Makefile
|
@ -20,12 +20,12 @@ REPL_ISSUE_TESTS = $(wildcard t/issue/*.sh)
|
||||||
|
|
||||||
TEST_RUNNER = bin/picrin
|
TEST_RUNNER = bin/picrin
|
||||||
|
|
||||||
CFLAGS += -I./extlib/benz/include -Wall -Wextra $(CONTRIB_DEFS)
|
CFLAGS += -I./extlib/benz/include -Wall -Wextra
|
||||||
LDFLAGS += -lm
|
LDFLAGS += -lm
|
||||||
|
|
||||||
prefix ?= /usr/local
|
prefix ?= /usr/local
|
||||||
|
|
||||||
all: CFLAGS += -O2 -DNDEBUG=1
|
all: CFLAGS += -O2 -flto -DNDEBUG=1
|
||||||
all: bin/picrin
|
all: bin/picrin
|
||||||
|
|
||||||
debug: CFLAGS += -O0 -g
|
debug: CFLAGS += -O0 -g
|
||||||
|
@ -33,8 +33,9 @@ debug: bin/picrin
|
||||||
|
|
||||||
include $(sort $(wildcard contrib/*/nitro.mk))
|
include $(sort $(wildcard contrib/*/nitro.mk))
|
||||||
|
|
||||||
bin/picrin: $(PICRIN_OBJS) $(CONTRIB_OBJS) lib/libbenz.so
|
bin/picrin: CFLAGS += $(CONTRIB_DEFS)
|
||||||
$(CC) $(CFLAGS) -o $@ $(PICRIN_OBJS) $(CONTRIB_OBJS) lib/libbenz.so $(LDFLAGS)
|
bin/picrin: $(PICRIN_OBJS) $(CONTRIB_OBJS) $(BENZ_OBJS)
|
||||||
|
$(CC) $(CFLAGS) -o $@ $(PICRIN_OBJS) $(CONTRIB_OBJS) $(BENZ_OBJS) $(LDFLAGS)
|
||||||
|
|
||||||
src/load_piclib.c: $(CONTRIB_LIBS)
|
src/load_piclib.c: $(CONTRIB_LIBS)
|
||||||
perl etc/mkloader.pl $(CONTRIB_LIBS) > $@
|
perl etc/mkloader.pl $(CONTRIB_LIBS) > $@
|
||||||
|
|
|
@ -186,7 +186,7 @@ int xfputs(pic_state *pic, const char *s, xFILE *stream) {
|
||||||
}
|
}
|
||||||
|
|
||||||
char *xfgets(pic_state *pic, char *s, int size, xFILE *stream) {
|
char *xfgets(pic_state *pic, char *s, int size, xFILE *stream) {
|
||||||
int c;
|
int c = 0;
|
||||||
char *buf;
|
char *buf;
|
||||||
|
|
||||||
xfflush(pic, NULL);
|
xfflush(pic, NULL);
|
||||||
|
|
|
@ -131,10 +131,10 @@ typedef unsigned long uint32_t;
|
||||||
|
|
||||||
#define PIC_FALLTHROUGH ((void)0)
|
#define PIC_FALLTHROUGH ((void)0)
|
||||||
|
|
||||||
#if __cplusplus
|
#if defined(__cplusplus)
|
||||||
# define PIC_UNUSED(v)
|
# define PIC_UNUSED(v)
|
||||||
#elif __GNUC__ || __clang__
|
#elif __GNUC__ || __clang__
|
||||||
# define PIC_UNUSED(v) __attribute__((unused)) v
|
# define PIC_UNUSED(v) v __attribute__((unused))
|
||||||
#else
|
#else
|
||||||
# define PIC_UNUSED(v) v
|
# define PIC_UNUSED(v) v
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -61,7 +61,7 @@ void
|
||||||
pic_make_library(pic_state *pic, const char *lib)
|
pic_make_library(pic_state *pic, const char *lib)
|
||||||
{
|
{
|
||||||
khash_t(ltable) *h = &pic->ltable;
|
khash_t(ltable) *h = &pic->ltable;
|
||||||
const char *old_lib;
|
const char *old_lib = NULL;
|
||||||
pic_value name, env, exports;
|
pic_value name, env, exports;
|
||||||
int it;
|
int it;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
Loading…
Reference in New Issue