1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Build all Flex files standalone

The proposed Meson build system will need a way to ignore certain
generated files in order to coexist with the autoconf build system,
and C files generated by Flex which are #include'd into .y files make
this more difficult. In similar vein to 72b1e3a21, arrange for all Flex
C files to compile to their own .o targets.

Reviewed by Andres Freund

Discussion: https://www.postgresql.org/message-id/20220810171935.7k5zgnjwqzalzmtm%40awork3.anarazel.de
Discussion: https://www.postgresql.org/message-id/CAFBsxsF8Gc2StS3haXofshHCzqNMRXiSxvQEYGwnFsTmsdwNeg@mail.gmail.com
This commit is contained in:
John Naylor
2022-09-04 11:33:31 +07:00
parent 80e8450a74
commit dac048f71e
38 changed files with 307 additions and 190 deletions

View File

@ -4,7 +4,8 @@ MODULE_big = cube
OBJS = \
$(WIN32RES) \
cube.o \
cubeparse.o
cubeparse.o \
cubescan.o
EXTENSION = cube
DATA = cube--1.2.sql cube--1.2--1.3.sql cube--1.3--1.4.sql cube--1.4--1.5.sql \
@ -15,8 +16,6 @@ HEADERS = cubedata.h
REGRESS = cube cube_sci
EXTRA_CLEAN = y.tab.c y.tab.h
SHLIB_LINK += $(filter -lm, $(LIBS))
ifdef USE_PGXS
@ -30,11 +29,16 @@ include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
endif
# See notes in src/backend/parser/Makefile about the following two rules
cubeparse.h: cubeparse.c
touch $@
# cubescan is compiled as part of cubeparse
cubeparse.o: cubescan.c
cubeparse.c: BISONFLAGS += -d
# Force these dependencies to be known even without dependency info built:
cubeparse.o cubescan.o: cubeparse.h
distprep: cubeparse.c cubescan.c
maintainer-clean:
rm -f cubeparse.c cubescan.c
rm -f cubeparse.h cubeparse.c cubescan.c