From: David Given Date: Mon, 14 Mar 2016 19:58:19 +0000 (+0100) Subject: Don't use the ACK preprocessor on host files --- use the host preprocessor X-Git-Tag: release-6-0-pre-5~8 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=88e13ecce3125a163b92158d646600e5dcdf5d3d;p=ack.git Don't use the ACK preprocessor on host files --- use the host preprocessor instead. --HG-- branch : default-branch --- diff --git a/first/core.mk b/first/core.mk index 0ee653a1c..6c386d0f5 100644 --- a/first/core.mk +++ b/first/core.mk @@ -28,6 +28,26 @@ define cfile $(eval $(cfile-rule)) endef +# --- Host preprocessor + +define cppfile-rule +$o: $s + @echo CPP $o + @mkdir -p $(dir $o) + @$(CC) $(CFLAGS) $(cflags) -MM -MQ $o -o $d -x c $s + $(hide) $(CC) $(CFLAGS) $(cflags) -E -P -o $o -x c $s +endef + +define cppfile + $(eval s := $1) + $(eval o := $(OBJDIR)/$(objdir)/$(1:=.m)) + $(eval d := $(OBJDIR)/$(objdir)/$(1:=.d)) + $(eval DEPENDS += $d) + $(eval CLEANABLES += $o $d) + $(eval q += $o) + $(eval $(cppfile-rule)) +endef + # --- ACK compiler define ackfile-rule diff --git a/mach/proto/as/build.mk b/mach/proto/as/build.mk index d11ccf2b6..64c75cf91 100644 --- a/mach/proto/as/build.mk +++ b/mach/proto/as/build.mk @@ -24,24 +24,16 @@ define build-as-impl $(call yacc, $(OBJDIR)/$D, $(OBJDIR)/$D/preprocessed-comm2.y) -$(eval CLEANABLES += $(OBJDIR)/$D/preprocessed-comm2.y) -$(OBJDIR)/$D/preprocessed-comm2.y: mach/proto/as/comm2.y $(CPPANSI) \ - mach/$(ARCH)/as/mach1.c \ - mach/$(ARCH)/as/mach2.c \ - mach/$(ARCH)/as/mach3.c \ - mach/$(ARCH)/as/mach4.c - @echo PREPROCESS $$@ - @mkdir -p $$(dir $$@) - $(hide) $(CPPANSI) -P \ - -Imach/$(ARCH)/as \ - -Imach/proto/as \ - -Ih \ - mach/proto/as/comm2.y > $$@ - $(call rawfile, $(LIBOBJECT)) $(call cprogram, $(BINDIR)/$(PLATFORM)/as) $(call installto, $(PLATDEP)/$(PLATFORM)/as) + $(call reset) + $(eval cflags += -Imach/$(ARCH)/as -I$(OBJDIR)/$D) + $(eval objdir := $(ARCH)) + $(call cppfile, mach/proto/as/comm2.y) + $(call installto, $(OBJDIR)/$D/preprocessed-comm2.y) + $(call reset) $(call rawfile, man/$(ARCH)_as.6) $(call installto, $(INSDIR)/share/man/man6/$(ARCH)_as.6)