Make sure that pcc and the assembler build in different directories to
authorDavid Given <dg@cowlark.com>
Sat, 19 Mar 2016 13:52:29 +0000 (14:52 +0100)
committerDavid Given <dg@cowlark.com>
Sat, 19 Mar 2016 13:52:29 +0000 (14:52 +0100)
prevent y.tab.c stomping.

--HG--
branch : default-branch

mach/proto/as/build.mk
plat/build.mk

index 64c75cf..ef09491 100644 (file)
@@ -1,38 +1,40 @@
 define build-as-impl
+       $(eval E := $(OBJDIR)/$D/as)
+
     $(call reset)
 
-    $(eval cflags += -Imach/$(ARCH)/as -I$(OBJDIR)/$D)
+    $(eval cflags += -Imach/$(ARCH)/as -I$E)
     $(eval objdir := $(ARCH))
 
     $(call cfile, mach/proto/as/comm3.c)
-    $(call dependson, $(OBJDIR)/$D/y.tab.h)
+    $(call dependson, $E/y.tab.h)
 
     $(call cfile, mach/proto/as/comm4.c)
-    $(call dependson, $(OBJDIR)/$D/y.tab.h)
+    $(call dependson, $E/y.tab.h)
 
     $(call cfile, mach/proto/as/comm5.c)
-    $(call dependson, $(OBJDIR)/$D/y.tab.h)
+    $(call dependson, $E/y.tab.h)
 
     $(call cfile, mach/proto/as/comm6.c)
-    $(call dependson, $(OBJDIR)/$D/y.tab.h)
+    $(call dependson, $E/y.tab.h)
 
     $(call cfile, mach/proto/as/comm7.c)
-    $(call dependson, $(OBJDIR)/$D/y.tab.h)
+    $(call dependson, $E/y.tab.h)
 
     $(call cfile, mach/proto/as/comm8.c)
-    $(call dependson, $(OBJDIR)/$D/y.tab.h)
+    $(call dependson, $E/y.tab.h)
 
-       $(call yacc, $(OBJDIR)/$D, $(OBJDIR)/$D/preprocessed-comm2.y)
+       $(call yacc, $E, $E/preprocessed-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 cflags += -Imach/$(ARCH)/as -I$E)
     $(eval objdir := $(ARCH))
        $(call cppfile, mach/proto/as/comm2.y)
-       $(call installto, $(OBJDIR)/$D/preprocessed-comm2.y)
+       $(call installto, $E/preprocessed-comm2.y)
 
     $(call reset)
     $(call rawfile, man/$(ARCH)_as.6)
index f710203..5cd80b9 100644 (file)
@@ -8,7 +8,7 @@ endef
 
 define build-platform-impl
     $(call reset)
-       $(eval q := $D/descr)
+       $(call rawfile, $D/descr)
        $(call installto, $(PLATIND)/descr/$(PLATFORM))
 
        $(foreach f, $(platform-headers), $(call build-platform-headers, $f))
@@ -66,10 +66,17 @@ endef
 build-platform = $(eval $(call build-platform-impl, $1))
 
 define build-pcc-platform-impl
+    $(call reset)
+       $(call rawfile, $D/descr)
+       $(call installto, $(PLATIND)/descr/$(PLATFORM))
+
        $(eval PLATFORM_$(PLATFORM) := \
+                       $(PLATIND)/descr/$(PLATFORM) \
+                       $(PLATDEP)/$(PLATFORM)/as \
                        $(PLATDEP)/$(PLATFORM)/pcc_ccom \
        )
 
+       $(call build-as)
        $(call build-pcc)
 endef