make append and separate by white space
https://superuser.com/questions/360178/what-does-make-install-do
Trying to understand the following make command.
installincludes:
$(INSTALL) -d '$(DESTDIR)$(includedir_server)/'
$(INSTALL_DATA) $(addprefix $(srcdir)/, $(RELATIVE_INCLUDES)) '$(DESTDIR)$(includedir_server)/'
rg is rigrep regex command, like grep.
To understand this, I first begin with includedir_server.
pg_config | rg server
return
INCLUDEDIR-SERVER = /usr/include/postgresql/15/server
In folder /src (postgresql source code) do
cat Makefile.global.in | rg --line-number 'includedir_server'
return
170:includedir_server = $(pkgincludedir)/server
248:override CPPFLAGS := -I$(includedir_server) -I$(includedir_internal) $(CPPFLAGS)
To understand $(INSTALL) -d '$(DESTDIR)$(includedir_server)/' now I feel like the follow logic is true.
$(includedir_server) == $(pkgincludedir)/server == /usr/include/postgresql/15/server
But if the above logic is true, then $(includedir_server) is already a full path. Then what is $(DESTDIR)?
also $(INSTALL) -d what does this part do?