comparison src/gearsTools/pmake.pl @ 69:f236eba62a76

off-the-shelf cmakefile
author anatofuz
date Sun, 28 Jul 2019 20:03:15 +0900
parents 101b229f182d
children c976a8bbe8c5
comparison
equal deleted inserted replaced
68:eafd3ba7f48b 69:f236eba62a76
19 $asm = $cc; 19 $asm = $cc;
20 $cflags = qq|-B/mnt/dalmore-home/one/src/armgcc/cross/bin/arm-none-eabi- 20 $cflags = qq|-B/mnt/dalmore-home/one/src/armgcc/cross/bin/arm-none-eabi-
21 -DCBCXV6=1 -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -I. -g -O0|; 21 -DCBCXV6=1 -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -I. -g -O0|;
22 $ld = '/mnt/dalmore-home/one/src/armgcc/cross/bin/arm-none-eabi-ld'; 22 $ld = '/mnt/dalmore-home/one/src/armgcc/cross/bin/arm-none-eabi-ld';
23 chomp($libgcc = `$cc --print-libgcc-file-name`); 23 chomp($libgcc = `$cc --print-libgcc-file-name`);
24 $cflags .= " $libgcc";
25 $cmake .= 3; 24 $cmake .= 3;
26 $ldflags = " -L. -T kernel-cmake.ld"; 25 $ldflags = " -L. -T kernel-cmake.ld";
27 $kernel_cflags = '-march=armv6 -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -Werror -I. -g -O0 -iquote ../ -c'; 26 $kernel_cflags = '-march=armv6 -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -Werror -I. -g -O0 -iquote ../ -c';
28 # -DX_CMAKE_C_LINK_EXECUTABLE=\"$ld $ldflags -o kernel.elf <OBJECTS> $libgcc -b binary initcode usr/fs.img\" 27 # -DX_CMAKE_C_LINK_EXECUTABLE=\"$ld $ldflags -o kernel.elf <OBJECTS> $libgcc -b binary initcode usr/fs.img\"
29 $kernel_ld_flags = ' -L. -N -e main -Ttext 0 <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -L ../ /mnt/dalmore-home/one/src/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/libgcc.a'; 28 $kernel_ld_flags = ' -L. -N -e main -Ttext 0 <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -L ../ /mnt/dalmore-home/one/src/gcc-arm-none-eabi-6-2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/libgcc.a';
34 33
35 $cflags =~ s/\n//g; 34 $cflags =~ s/\n//g;
36 create_link_script(); 35 create_link_script();
37 36
38 print_exec_system($cmake, 37 print_exec_system($cmake,
39 "-DGCC_LIB=$libgcc",
40 "-DCBC_COM=$cc", 38 "-DCBC_COM=$cc",
41 "-DPMAKE_ARGS=\"$cflags\"", 39 "-DPMAKE_ARGS=\"$cflags\"",
42 "-DCMAKE_ASM_COMPILER=$cc", 40 "-DCMAKE_ASM_COMPILER=$cc",
43 "-DX_CMAKE_LINKER=$ld", 41 "-DX_CMAKE_LINKER=$ld",
44 "-DX_CMAKE_C_LINK_EXECUTABLE=\"$ld $ldflags -o kernel.elf <OBJECTS> $libgcc -b binary initcode fs.img\"", 42 "-DX_CMAKE_C_LINK_EXECUTABLE=\"$ld $ldflags -o kernel.elf <OBJECTS> $libgcc -b binary initcode fs.img\"",
45 "-DKERNEL_LINK_EXECUTABLE=\"$kernel_ld_command\"", 43 "-DKERNEL_LINK_EXECUTABLE=\"$kernel_ld_command\"",
46 "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE", 44 "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE",
47 "-DINITOCDE_CFLAGS=\"$initcode_cflags\"", 45 "-DINITOCDE_CFLAGS=\"$initcode_cflags\"",
48 "-DINITOCDE_LINK_EXECUTABLE=\"$initcode_ld_command\"", 46 "-DINITOCDE_LINK_EXECUTABLE=\"$initcode_ld_command\"",
49 @ARGV); 47 "-S $ARGV[1]",
48 $ARGV[0]);
50 49
51 system("make"); 50 system("make");
52 #system("sh","link.sh"); 51 #system("sh","link.sh");
53 52
54 sub create_link_script { 53 sub create_link_script {