cleanup root and unfuck CMakeLists.txt

This commit is contained in:
Amrit Panesar committed 2016-10-19 00:56:35 -07:00
1 parent ad4461fde6
commit 8b4c71951e
37 files changed
+25 -17

No files matched your search

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1 -3
View File
@@ -1,6 +1,7 @@
# Created by https://www.gitignore.io/api/osx,windows,git,c,c++,visualstudio,visualstudiocode,sublimetext,netbeans,intellij,sublimetext,cmake,codeblocks,assembler,atmelstudio,eclipse,jetbrains,linux,macos # Created by https://www.gitignore.io/api/osx,windows,git,c,c++,visualstudio,visualstudiocode,sublimetext,netbeans,intellij,sublimetext,cmake,codeblocks,assembler,atmelstudio,eclipse,jetbrains,linux,macos
scripts/deploy.sh scripts/deploy.sh
bin/
### Intellij ### ### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
@@ -91,9 +92,6 @@ Temporary Items
*.o *.o
*.ko *.ko
*.obj *.obj
*.elf
*.bin
*.img
# Linker output # Linker output
*.ilk *.ilk
+15 -11
View File
@@ -34,31 +34,35 @@ cmake_minimum_required( VERSION 2.8 )
# Mark the language as C so that CMake doesn't try to test the C++ # Mark the language as C so that CMake doesn't try to test the C++
# cross-compiler's ability to compile a simple program because that will fail # cross-compiler's ability to compile a simple program because that will fail
project( bare-metal-rpi-kernel C ASM ) project( bare-metal-rpi-kernel C ASM )
enable_language(C ASM)
set( TARGET_FILE "kernel")
set( TARGET_BUILD "${TARGET_FILE}.elf")
set( TARGET_OUTPUT "${TARGET_FILE}.img")
# Add any C compiler flags here. The C flags concerned with processor tuning # Add any C compiler flags here. The C flags concerned with processor tuning
# are in the toolchain files toolchain-arm-none-eabi-bcm2835.cmake, etc. # are in the toolchain files toolchain-arm-none-eabi-bcm2835.cmake, etc.
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O4" ) set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O4" )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall" ) set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall" )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -nostartfiles" ) set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -nostartfiles" )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I ../includes/" ) set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I src/includes/" )
# Set the linker flags so that we use our "custom" linker script # Set the linker flags so that we use our "custom" linker script
set( CMAKE_EXE_LINKER_FLAGS "-Wl,-T,${PROJECT_SOURCE_DIR}/CMakeLinker.x" ) set( CMAKE_EXE_LINKER_FLAGS "-Wl,-T,src/CMakeLinker.x" )
AUX_SOURCE_DIRECTORY(includes/ kernelIncludes) AUX_SOURCE_DIRECTORY(src source)
AUX_SOURCE_DIRECTORY(includes/rpi rpiIncludes) AUX_SOURCE_DIRECTORY(src/includes/ kernelIncludes)
AUX_SOURCE_DIRECTORY(src/includes/rpi rpiIncludes)
add_executable( kernel.elf add_executable( ${TARGET_BUILD}
kernel.c src/armStart.S
cstartup.c ${source}
cstubs.c
armStart.S
${kernelIncludes} ${kernelIncludes}
${rpiIncludes} ${rpiIncludes}
) )
add_custom_command( add_custom_command(
TARGET kernel.elf POST_BUILD TARGET ${TARGET_BUILD} POST_BUILD
COMMAND ${CMAKE_OBJCOPY} ./kernel.elf -O binary ./kernel.img COMMAND ${CMAKE_OBJCOPY} ${TARGET_BUILD} -O binary ${TARGET_OUTPUT}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Convert the ELF output file to a binary image" ) COMMENT "Convert the ELF output file to a binary image" )
Executable
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
./configure && make && ./deploy
Vendored Executable
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=./src/toolchain-arm-none-eabi-rpi.cmake ./
Executable
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
cp kernel.img /Volumes/boot/ && sudo umount /Volumes/boot
Executable
BIN
View File
Binary file not shown.
Executable
BIN
View File
Binary file not shown.
-3
View File
@@ -1,3 +0,0 @@
#!/bin/sh
cmake -G "CodeBlocks - Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=../toolchain-arm-none-eabi-rpi.cmake ../
View File
File renamed without changes.
View File
File renamed without changes.
View File
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View File
File renamed without changes.
File renamed without changes.