Changes XCC_ROOT->XCC_TARGET_ROOT
authorBarret Rhoden <brho@cs.berkeley.edu>
Fri, 7 Jun 2013 20:39:24 +0000 (13:39 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Fri, 7 Jun 2013 20:39:24 +0000 (13:39 -0700)
And makes it not depend on $ARCH.

Makefile
tests/openmp/Makefrag
user/benchutil/Makefile
user/parlib/Makefile
user/pthread/Makefile

index 1e8ed6f..8ca47ba 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -207,8 +207,8 @@ endif
 # Computing these without a cross compiler complains loudly
 gcc-lib := $(shell $(CC) -print-libgcc-file-name)
 NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
-# Note: calling this GCC_ROOT interferes with the host tools
-XCC_ROOT := $(dir $(shell which $(CC)))../
+XCC_TARGET_ROOT := $(dir $(shell which $(CC)))../$(patsubst %-,%,\
+                                                   $(CROSS_COMPILE))
 endif
 
 CFLAGS_KERNEL += -O2 -pipe -MD -gstabs
@@ -235,7 +235,7 @@ KBUILD_CHECKSRC := 0
 export AKAROSINCLUDE CROSS_COMPILE
 export CC CPP AS AR LD OBJCOPY OBJDUMP NM STRIP
 export CFLAGS_KERNEL AFLAGS_KERNEL
-export NOSTDINC_FLAGS XCC_ROOT
+export NOSTDINC_FLAGS XCC_TARGET_ROOT
 export KBUILD_BUILTIN KBUILD_CHECKSRC
 
 CFLAGS_USER += -O2 -std=gnu99 -fno-stack-protector -fgnu89-inline
@@ -507,7 +507,7 @@ install-tests:
 # TODO: cp -u all of the .sos, but flush it on an arch change (same with tests)
 fill-kfs: install-libs install-tests
        @mkdir -p $(FIRST_KFS_PATH)/lib
-       @cp $(addprefix $(XCC_ROOT)/$(ARCH)-ros/lib/, \
+       @cp $(addprefix $(XCC_TARGET_ROOT)/lib/, \
          libc.so.6 ld.so.1 libm.so libgcc_s.so.1) $(FIRST_KFS_PATH)/lib
        $(Q)$(STRIP) --strip-debug $(addprefix $(FIRST_KFS_PATH)/lib/, \
                                               libc.so.6 ld.so.1)
index e06ddaa..e303990 100644 (file)
@@ -2,7 +2,7 @@ OPENMP_TESTS_DIR = $(TESTS_DIR)/openmp
 
 OPENMP_TESTS_CFLAGS += $(CFLAGS_TESTS) \
                      -fopenmp \
-                     -I$(XCC_ROOT)/$(ARCH)-ros/sys-include/openmp
+                     -I$(XCC_TARGET_ROOT)/sys-include/openmp
 
 ALL_OPENMP_TEST_FILES = $(shell ls $(OPENMP_TESTS_DIR)/*.c)
 
index f31a705..4994510 100644 (file)
@@ -38,10 +38,10 @@ $(FINALLIB): $(OBJS)
        $(Q)$(AR) rc $@ $(OBJS)
 
 install: $(FINALLIB)
-       @cp $(FINALLIB) $(XCC_ROOT)/$(ARCH)-ros/lib/
-       @cp -R $(INCDIR)/* $(XCC_ROOT)/$(ARCH)-ros/sys-include/
-       @rm -rf $(XCC_ROOT)/$(ARCH)-ros/sys-include/benchutil
-       @ln -fs . $(XCC_ROOT)/$(ARCH)-ros/sys-include/benchutil
+       @cp $(FINALLIB) $(XCC_TARGET_ROOT)/lib/
+       @cp -R $(INCDIR)/* $(XCC_TARGET_ROOT)/sys-include/
+       @rm -rf $(XCC_TARGET_ROOT)/sys-include/benchutil
+       @ln -fs . $(XCC_TARGET_ROOT)/sys-include/benchutil
 
 clean: 
        @echo + clean [$(LIBUCNAME)]
index 15596f9..9d6c67d 100644 (file)
@@ -38,10 +38,10 @@ $(FINALLIB): $(OBJS)
        $(Q)$(AR) rc $@ $(OBJS)
 
 install: $(FINALLIB)
-       @cp $(FINALLIB) $(XCC_ROOT)/$(ARCH)-ros/lib/
-       @cp -R $(INCDIR)/* $(XCC_ROOT)/$(ARCH)-ros/sys-include/
-       @rm -rf $(XCC_ROOT)/$(ARCH)-ros/sys-include/parlib  
-       @ln -fs . $(XCC_ROOT)/$(ARCH)-ros/sys-include/parlib  
+       @cp $(FINALLIB) $(XCC_TARGET_ROOT)/lib/
+       @cp -R $(INCDIR)/* $(XCC_TARGET_ROOT)/sys-include/
+       @rm -rf $(XCC_TARGET_ROOT)/sys-include/parlib  
+       @ln -fs . $(XCC_TARGET_ROOT)/sys-include/parlib  
 
 clean: 
        @echo + clean [$(LIBUCNAME)]
index 87bdc37..a5b975c 100644 (file)
@@ -30,8 +30,8 @@ $(FINALLIB): $(OBJS)
        $(Q)$(AR) rc $@ $(OBJS)
 
 install: $(FINALLIB)
-       @cp $(FINALLIB) $(XCC_ROOT)/$(ARCH)-ros/lib/
-       @cp -R $(INCDIR)/*.h $(XCC_ROOT)/$(ARCH)-ros/sys-include/
+       @cp $(FINALLIB) $(XCC_TARGET_ROOT)/lib/
+       @cp -R $(INCDIR)/*.h $(XCC_TARGET_ROOT)/sys-include/
 
 clean: 
        @echo + clean [$(LIBUCNAME)]