This is an automated email from the ASF dual-hosted git repository.
ako pushed a commit to branch AGE_CLI
in repository https://gitbox.apache.org/repos/asf/age.git
The following commit(s) were added to refs/heads/AGE_CLI by this push:
new f0156ef3 Make some changes in Makefile to remove compilation error.
(#821)
f0156ef3 is described below
commit f0156ef3e883d7a2c9a15747355abceb8b7b5c78
Author: Moiz Ibrar <[email protected]>
AuthorDate: Sun Apr 30 16:42:17 2023 +0500
Make some changes in Makefile to remove compilation error. (#821)
* Make some changes in Makefile to remove compilation error.
Removed the Makefile.global entry and added path to include files.
You need to export PGSRC to the PostgreSQL path.
* Make some changes in Makefile to remove compilation error.
Now psql is compilable without the PostgreSQL source code.
---
Makefile | 58 +++++++++++++---------------------------------------------
1 file changed, 13 insertions(+), 45 deletions(-)
diff --git a/Makefile b/Makefile
index 58ec4a89..2d14f690 100644
--- a/Makefile
+++ b/Makefile
@@ -14,14 +14,20 @@ PGAPPICON=win32
subdir = src/bin/psql
top_builddir = ../../..
-include $(top_builddir)/src/Makefile.global
-# make this available to TAP test scripts
-export with_readline
+PG_CONFIG = pg_config
-REFDOCDIR= $(top_srcdir)/doc/src/sgml/ref
+ifdef USE_PGXS
+PGXS := $(shell $(PG_CONFIG) --pgxs)
+include $(PGXS)
+else
+subdir = bin/
+top_builddir = ../..
+include $(top_builddir)/src/Makefile.global
+include $(top_srcdir)/src/Makefile.global
+endif
-override CPPFLAGS := -I. -I$(srcdir) -I$(libpq_srcdir) $(CPPFLAGS)
+override CPPFLAGS := -I. -I$(srcdir) -I$(libpq_srcdir)
-I$(top_srcdir)/src/include -I$(top_srcdir)/src/interfaces/libpq $(CPPFLAGS)
LDFLAGS_INTERNAL += -L$(top_builddir)/src/fe_utils -lpgfeutils $(libpq_pgport)
OBJS = \
@@ -46,45 +52,7 @@ OBJS = \
all: psql
-psql: $(OBJS) | submake-libpq submake-libpgport submake-libpgfeutils
- $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
-
-help.o: sql_help.h
-
-# See notes in src/backend/parser/Makefile about the following two rules
-sql_help.c: sql_help.h
- touch $@
-
-sql_help.h: create_help.pl $(wildcard $(REFDOCDIR)/*.sgml)
- $(PERL) $< $(REFDOCDIR) $*
-
-psqlscanslash.c: FLEXFLAGS = -Cfe -p -p
-psqlscanslash.c: FLEX_NO_BACKUP=yes
-psqlscanslash.c: FLEX_FIX_WARNING=yes
-
-distprep: sql_help.h sql_help.c psqlscanslash.c
-
-install: all installdirs
- $(INSTALL_PROGRAM) psql$(X) '$(DESTDIR)$(bindir)/psql$(X)'
- $(INSTALL_DATA) $(srcdir)/psqlrc.sample
'$(DESTDIR)$(datadir)/psqlrc.sample'
-
-installdirs:
- $(MKDIR_P) '$(DESTDIR)$(bindir)' '$(DESTDIR)$(datadir)'
-
-uninstall:
- rm -f '$(DESTDIR)$(bindir)/psql$(X)'
'$(DESTDIR)$(datadir)/psqlrc.sample'
-
-clean distclean:
- rm -f psql$(X) $(OBJS) lex.backup
- rm -rf tmp_check
-
-# files removed here are supposed to be in the distribution tarball,
-# so do not clean them in the clean/distclean rules
-maintainer-clean: distclean
- rm -f sql_help.h sql_help.c psqlscanslash.c
+psql: $(OBJS)
+ $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o agesql
-check:
- $(prove_check)
-installcheck:
- $(prove_installcheck)