changeset 47:233a68a261fe

ifdef cbcxv6
author mir3636
date Thu, 07 Mar 2019 19:42:27 +0900
parents 9647d79fe97e
children 58ec26c64601
files src/CMakeLists.txt src/context.h src/gearsTools/generate_context.pl
diffstat 3 files changed, 18 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/CMakeLists.txt	Sun Mar 03 17:39:45 2019 +0900
+++ b/src/CMakeLists.txt	Thu Mar 07 19:42:27 2019 +0900
@@ -5,11 +5,17 @@
 # -DUSE_CUDA
 #  add_definitions("-Wall -g -O")
 
-set(CMAKE_C_COMPILER $ENV{CBC_COMPILER})
-add_definitions("-Wall -g -arch arm -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -Werror -I. -g -O0 
-         -Wno-macro-redefined -Wno-gnu-designator -Wno-sometimes-uninitialized -Wno-tautological-compare 
-         -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include
-         -Wno-nullability-completeness -Wno-expansion-to-defined")
+if (APPLE)
+    set(CMAKE_C_COMPILER $ENV{CBC_LANG_COMPILER})
+    add_definitions("-Wall -g -arch arm -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -Werror -I. -g -O0 
+             -Wno-macro-redefined -Wno-gnu-designator -Wno-sometimes-uninitialized -Wno-tautological-compare 
+             -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include
+             -Wno-nullability-completeness -Wno-expansion-to-defined")
+else (APPLE)
+    set(CMAKE_C_COMPILER /mnt/dalmore-home/one/src/armgcc/cross/bin/arm-none-eabi-gcc)
+    add_definitions("-B/mnt/dalmore-home/one/src/armgcc/cross/bin/arm-none-eabi- 
+             -DCBCXV6=1 -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -I. -g -O0")
+endif (APPLE)
 
 # -DCMAKE_BUILD_TYPE=Debug
 set(CMAKE_C_FLAGS_DEBUG "-O0")
@@ -74,7 +80,7 @@
   TARGET
       kernel
   SOURCES
-	lib/string.c arm.c asm.S bio.c buddy.c console.c exec.c file.c fs.c log.c main.c memide.c pipe.c proc.c spinlock.c
+	lib/string.c arm.c asm.S bio.c buddy.c console.cbc exec.c file.c fs.c log.c main.c memide.c pipe.c proc.c spinlock.c
 	start.c swtch.S syscall.c sysfile.c sysproc.c trap_asm.S trap.c vm.c device/picirq.c device/timer.c device/uart.c
         entry-osx.S 
 )
--- a/src/context.h	Sun Mar 03 17:39:45 2019 +0900
+++ b/src/context.h	Thu Mar 07 19:42:27 2019 +0900
@@ -1,8 +1,12 @@
 /* Context definition for llrb example */
 #ifndef CONTEXT_H
 #define CONTEXT_H
+#ifdef CBCXV6
+
+#else
 #include <stdlib.h>
 #include <pthread.h>
+#endif
 #ifdef USE_CUDAWorker
 #include <cuda.h>
 #include <driver_types.h>
--- a/src/gearsTools/generate_context.pl	Sun Mar 03 17:39:45 2019 +0900
+++ b/src/gearsTools/generate_context.pl	Thu Mar 07 19:42:27 2019 +0900
@@ -144,7 +144,9 @@
     my $data_num = keys(%dataGear);
     $data_num++;
 my $context_c = << "EOFEOF";
+#ifndef CBCXV6
 #include <stdlib.h>
+#endif
 
 #include "../context.h"