+# Build the builtin-macros data struct
+
+MACRO_HSRC = predef.h os.h globals.h config.h \
+ routers/accept.h routers/dnslookup.h routers/ipliteral.h \
+ routers/iplookup.h routers/manualroute.h routers/queryprogram.h \
+ routers/redirect.h
+
+OBJ_MACRO_PLAIN = macro-predef.o \
+ macro-globals.o macro-readconf.o macro-route.o macro-transport.o macro-drtables.o \
+ macro-dkim.o
+OBJ_MACRO_TP = \
+ macro-appendfile.o macro-autoreply.o macro-lmtp.o macro-pipe.o macro-queuefile.o \
+ macro-smtp.o
+OBJ_MACRO_RT = \
+ macro-accept.o macro-dnslookup.o macro-ipliteral.o macro-iplookup.o \
+ macro-manualroute.o macro-queryprogram.o macro-redirect.o
+OBJ_MACRO_AU = \
+ macro-auth-spa.o macro-cram_md5.o macro-cyrus_sasl.o macro-dovecot.o macro-gsasl_exim.o \
+ macro-heimdal_gssapi.o macro-plaintext.o macro-spa.o macro-tls.o
+
+OBJ_MACRO = $(OBJ_MACRO_PLAIN) $(OBJ_MACRO_TP) $(OBJ_MACRO_RT) $(OBJ_MACRO_AU)
+$(OBJ_MACRO): $(MACRO_HSRC)
+
+$(OBJ_MACRO_PLAIN): macro-%.o : %.c
+ @echo "$(CC) -DMACRO_PREDEF $<"
+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ $<
+$(OBJ_MACRO_TP): macro-%.o : transports/%.c
+ @echo "$(CC) -DMACRO_PREDEF $<"
+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ $<
+$(OBJ_MACRO_RT): macro-%.o : routers/%.c
+ @echo "$(CC) -DMACRO_PREDEF $<"
+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ $<
+$(OBJ_MACRO_AU): macro-%.o : auths/%.c
+ @echo "$(CC) -DMACRO_PREDEF $<"
+ $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ $<
+
+macro_predef: $(OBJ_MACRO)
+ @echo "$(LNCC) -o $@"
+ $(FE)$(LNCC) -o $@ $(LFLAGS) $(OBJ_MACRO)
+
+macro.c: macro_predef
+ ./macro_predef > macro.c