Skip to content

Commit

Permalink
[BUILD] Set Teapot from config
Browse files Browse the repository at this point in the history
  • Loading branch information
PeyTy committed Aug 14, 2021
1 parent 09b92f7 commit e63c1e0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions build/assets.hexa
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

declare class Config {
let warnings: Bool
let teapot: String
var tempFolder: String
let tempFolderUnix: String
}
Expand Down
17 changes: 9 additions & 8 deletions build/main.hexa
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ let tasks: [String] = process.argv.slice()
let llvm = 'LLVM-12.0.0'
tasks.shift()
tasks.shift()
let nasm = isUnix? 'nasm' : '..\\Teapot\\nasm-2.14.02\\nasm'
let clang = isUnix? 'clang-12' : '..\\Teapot\\\(llvm)\\bin\\clang.exe'
let link = isUnix? 'lld-link-12' : '..\\Teapot\\\(llvm)\\bin\\lld-link.exe'
let xorriso = isUnix? 'xorriso' : '..\\Teapot\\xorriso-1.5.2\\xorriso.exe'
let mmd = isUnix? 'mmd' : '..\\Teapot\\mtools\\mmd.exe'
let mcopy = isUnix? 'mcopy' : '..\\Teapot\\mtools\\mcopy.exe'
let teapot = config.teapot
let nasm = isUnix? 'nasm' : '\(teapot)\\nasm-2.14.02\\nasm'
let clang = isUnix? 'clang-12' : '\(teapot)\\\(llvm)\\bin\\clang.exe'
let link = isUnix? 'lld-link-12' : '\(teapot)\\\(llvm)\\bin\\lld-link.exe'
let xorriso = isUnix? 'xorriso' : '\(teapot)\\xorriso-1.5.2\\xorriso.exe'
let mmd = isUnix? 'mmd' : '\(teapot)\\mtools\\mmd.exe'
let mcopy = isUnix? 'mcopy' : '\(teapot)\\mtools\\mcopy.exe'

if isUnix {
config.tempFolder = config.tempFolderUnix
Expand Down Expand Up @@ -320,7 +321,7 @@ for task in tasks {

// Create floppy image
fs.copyFileSync(
slash('..\\Teapot\\mtools\\disk-template.img'),
slash('\(teapot)\\mtools\\disk-template.img'),
slash(config.tempFolder + '\\tofita\\DISK.IMG'))
for cmd in [
mmd + ' -i ' + config.tempFolder + '\\tofita\\DISK.IMG ::/EFI',
Expand Down Expand Up @@ -359,7 +360,7 @@ for task in tasks {
}
case 'clang-format':
{
let clang = '..\\Teapot\\\(llvm)\\bin\\clang-format'
let clang = '\(teapot)\\\(llvm)\\bin\\clang-format'
let files: [String] = []

fun formatFolderRecursive(path) {
Expand Down
4 changes: 4 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"warnings": false,
"teapot": "..\\Teapot",
"tempFolderUnix": "/tmp",
"features": [
"example-like-mail-client-or-something"
],
"tempFolder": "C:"
}

0 comments on commit e63c1e0

Please sign in to comment.