| 1 |
|
| 2 |
PGFILEDESC = "standalone json parser tester" |
| 3 |
PGAPPICON = win32 |
| 4 |
|
| 5 |
TAP_TESTS = 1 |
| 6 |
|
| 7 |
OBJS = test_json_parser_incremental.o test_json_parser_perf.o $(WIN32RES) |
| 8 |
|
| 9 |
EXTRA_CLEAN = test_json_parser_incremental$(X) test_json_parser_incremental_shlib$(X) test_json_parser_perf$(X) |
| 10 |
|
| 11 |
ifdef USE_PGXS |
| 12 |
PG_CONFIG = pg_config |
| 13 |
PGXS := $(shell $(PG_CONFIG) --pgxs) |
| 14 |
include $(PGXS) |
| 15 |
else |
| 16 |
subdir = src/test/modules/test_json_parser |
| 17 |
top_builddir = ../../../.. |
| 18 |
include $(top_builddir)/src/Makefile.global |
| 19 |
include $(top_srcdir)/contrib/contrib-global.mk |
| 20 |
endif |
| 21 |
|
| 22 |
all: test_json_parser_incremental$(X) test_json_parser_incremental_shlib$(X) test_json_parser_perf$(X) |
| 23 |
|
| 24 |
%.o: $(top_srcdir)/$(subdir)/%.c |
| 25 |
|
| 26 |
test_json_parser_incremental$(X): test_json_parser_incremental.o $(WIN32RES) |
| 27 |
$(CC) $(CFLAGS) $^ $(PG_LIBS_INTERNAL) $(LDFLAGS) $(LDFLAGS_EX) $(PG_LIBS) $(LIBS) -o $@ |
| 28 |
|
| 29 |
test_json_parser_incremental_shlib$(X): test_json_parser_incremental.o $(WIN32RES) |
| 30 |
$(CC) $(CFLAGS) $^ $(LDFLAGS) -lpgcommon_excluded_shlib $(libpq_pgport_shlib) $(filter -lintl, $(LIBS)) -o $@ |
| 31 |
|
| 32 |
test_json_parser_perf$(X): test_json_parser_perf.o $(WIN32RES) |
| 33 |
$(CC) $(CFLAGS) $^ $(PG_LIBS_INTERNAL) $(LDFLAGS) $(LDFLAGS_EX) $(PG_LIBS) $(LIBS) -o $@ |
| 34 |
|
| 35 |
speed-check: test_json_parser_perf$(X) |
| 36 |
@echo Standard parser: |
| 37 |
time ./test_json_parser_perf 10000 $(top_srcdir)/$(subdir)/tiny.json |
| 38 |
@echo Incremental parser: |
| 39 |
time ./test_json_parser_perf -i 10000 $(top_srcdir)/$(subdir)/tiny.json |