Utility: exim_msgdate
[exim.git] / src / OS / Makefile-Base
index 0c64d45d4ae2a7b403ad99f5bef82ad5a4cc304a..29c0374013e0f3f820c9e90f5c97ac6600750086 100644 (file)
@@ -1,5 +1,4 @@
 # This file is the basis of the main makefile for Exim and friends. The
-#
 # makefile at the top level arranges to build the main makefile by calling
 # scripts/Configure-Makefile from within the build directory. This
 # concatenates the configuration settings from Local/Makefile and other,
@@ -7,6 +6,7 @@
 # build directory.
 #
 # Copyright (c) The Exim Maintainers 1995 - 2022
+# SPDX-License-Identifier: GPL-2.0-or-later
 
 SHELL      = $(MAKE_SHELL)
 SCRIPTS    = ../scripts
@@ -111,8 +111,8 @@ MACRO_HSRC = macro_predef.h os.h globals.h config.h macros.h \
        routers/redirect.h
 
 OBJ_MACRO = macro_predef.o \
-       macro-globals.o macro-readconf.o macro-route.o macro-transport.o macro-drtables.o \
-       macro-acl.o macro-tls.o \
+       macro-globals.o macro-readconf.o macro-expand.o macro-route.o \
+       macro-transport.o macro-drtables.o macro-acl.o macro-tls.o \
        macro-appendfile.o macro-autoreply.o macro-lmtp.o macro-pipe.o macro-queuefile.o \
        macro-smtp.o macro-accept.o macro-dnslookup.o macro-ipliteral.o macro-iplookup.o \
        macro-manualroute.o macro-queryprogram.o macro-redirect.o \
@@ -131,6 +131,9 @@ macro-globals.o :   globals.c
 macro-readconf.o :     readconf.c
        @echo "$(CC) -DMACRO_PREDEF readconf.c"
        $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ readconf.c
+macro-expand.o :       expand.c
+       @echo "$(CC) -DMACRO_PREDEF expand.c"
+       $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ expand.c
 macro-route.o :                route.c
        @echo "$(CC) -DMACRO_PREDEF route.c"
        $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ route.c
@@ -246,7 +249,8 @@ utils: $(EXIM_MONITOR) exicyclog exinext exiwhat \
         exigrep eximstats exipick exiqgrep exiqsumm \
         transport-filter.pl convert4r3 convert4r4 \
         exim_checkaccess \
-        exim_dbmbuild exim_dumpdb exim_fixdb exim_tidydb exim_lock
+        exim_dbmbuild exim_dumpdb exim_fixdb exim_tidydb exim_lock \
+        exim_msgdate
 
 
 # Targets for special-purpose configuration header builders
@@ -380,6 +384,23 @@ exigrep: config ../src/exigrep.src
        @chmod a+x exigrep
        @echo ">>> exigrep script built"
 
+exim_msgdate: config ../src/exim_msgdate.src
+       @rm -f exim_msgdate
+       @. ./version.sh && sed \
+         -e "s?PROCESSED_FLAG?This file has been so processed.?"\
+         -e "/^[ \t]*# /p" \
+         -e "/^[ \t]*# /d" \
+         -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
+         -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
+         -e "s?BASE_62?$${BASE_62:-62}?" \
+         -e "s?CONFIGURE_FILE\"?$(CONFIGURE_FILE)\"?" \
+         -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
+         -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
+         ../src/exim_msgdate.src > exim_msgdate-t
+       @mv exim_msgdate-t exim_msgdate
+       @chmod a+x exim_msgdate
+       @echo ">>> exim_msgdate script built"
+
 eximstats: config ../src/eximstats.src
        @rm -f eximstats
        @. ./version.sh && sed \