mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-30 05:11:27 +02:00
332d406140
The link commands in test_json_parser/Makefile were a long way shy of a load, as evidenced by buildfarm failures. Model them on pgxs.mk's PROGRAM rule. (Probably we should have put these two test programs in different subdirectories so we could actually use the PROGRAM rule. But I won't question that decision today.)
37 lines
1.1 KiB
Makefile
37 lines
1.1 KiB
Makefile
|
|
PGFILEDESC = "standalone json parser tester"
|
|
PGAPPICON = win32
|
|
|
|
TAP_TESTS = 1
|
|
|
|
OBJS = test_json_parser_incremental.o test_json_parser_perf.o
|
|
|
|
EXTRA_CLEAN = test_json_parser_incremental$(X) test_json_parser_perf$(X)
|
|
|
|
ifdef USE_PGXS
|
|
PG_CONFIG = pg_config
|
|
PGXS := $(shell $(PG_CONFIG) --pgxs)
|
|
include $(PGXS)
|
|
else
|
|
subdir = src/test/modules/test_json_parser
|
|
top_builddir = ../../../..
|
|
include $(top_builddir)/src/Makefile.global
|
|
include $(top_srcdir)/contrib/contrib-global.mk
|
|
endif
|
|
|
|
all: test_json_parser_incremental$(X) test_json_parser_perf$(X)
|
|
|
|
%.o: $(top_srcdir)/$(subdir)/%.c
|
|
|
|
test_json_parser_incremental$(X): test_json_parser_incremental.o
|
|
$(CC) $(CFLAGS) $^ $(PG_LIBS_INTERNAL) $(LDFLAGS) $(LDFLAGS_EX) $(PG_LIBS) $(LIBS) -o $@
|
|
|
|
test_json_parser_perf$(X): test_json_parser_perf.o
|
|
$(CC) $(CFLAGS) $^ $(PG_LIBS_INTERNAL) $(LDFLAGS) $(LDFLAGS_EX) $(PG_LIBS) $(LIBS) -o $@
|
|
|
|
speed-check: test_json_parser_perf$(X)
|
|
@echo Standard parser:
|
|
time ./test_json_parser_perf 10000 $(top_srcdir)/$(subdir)/tiny.json
|
|
@echo Incremental parser:
|
|
time ./test_json_parser_perf -i 10000 $(top_srcdir)/$(subdir)/tiny.json
|