unstable
Penguin 3 years ago
parent 8d276c3f5a
commit 152968312e

@ -0,0 +1,9 @@
# Igloo Change Log
I needed to make a changelog, but I didn't really know how to do this in a way that didn't make me look like an idiot. This isn't really a change log for code. It's like a change log for project level decisions or just places for me to put checkpoints and describe what I'm doing. Idk if this is dumb feel free to tell me a better way to do this.
## [1-10-2021] Adding user level configurations for targets
I'm adding user level configurations for targets. They will be in the [user] section. I need to fill out some sort of extensive database-style file with all possible configurations in it. For now, I'm making a file named target_configurations.toml to store these things in.

@ -0,0 +1,36 @@
# Target Configurations
# The default [esf] sections have been removed because they aren't important here.
# What is important in your target.toml files is your user section.
# You can define things like extra include directories, more object files, and more.
# One thing to note is that arrays will ADD to the make variable. Regular strings will
# REPLACE the variable if it already exists.
# Example
# inc_dirs = ["inc/dir/one", "inc/dir/two" ]
# This will ADD to the already existing include directories in your makefile
#
# toolchain = "/usr/bin/arm-unknown-eabi"
# This will REPLACE the already existing toolchain variable.
#
#
# In order to revert from these changes to the defaults, you just need to remove the variables.
# Igloo will restore the missing variables with their originals.
[esf]
# ignore this section. Focus on the user section
[user]
# esf modules have yet to be created, but when they are created, they will be added like this.
modules = ["usart_sync", "usart_async"]
# At some point, igloo will support some editors. This just means producing a project file or a specific directory
# so that your editor or ide will already see your project as a project and not just a bunch of files.
# The editor var will also be allowed to include some extra support like bear (for generating compile_commands.json)
# This has not yet been implemented.
# editor = ["nvim", "bear"]
[user.make]
toolchain = "/usr/bin/arm-unknown-eabi" # custom toolchain path here
objs = ["my/object.o"]
# inc_dirs: Specify include directories you want the toolchain to see
# Specify paths from the root of your project, not absolute dirs
inc_dirs = ["inc/dir/one", "inc/dir/two"]

@ -130,6 +130,42 @@ pub fn ia_new(igloo: &Igloo, project_name: String, initial_target: String) -> Ig
ret ret
} }
pub fn ia_build(igloo: &Igloo) -> IglooStatus
{
let mut ret: IglooStatus = IS_GOOD;
loop
{
if !IglooProject::is_igloo_prj(&igloo.env.cwd)
{
ret = IS_NOT_IGLOO_DIRECTORY;
break;
}
let mut prj = match IglooProject::from_existing(&igloo)
{
Ok(v) => v,
Err(e) =>
{
ret = e;
break;
},
};
break;}
if ret != IS_GOOD
{
igloo_debug!(ERROR, ret);
}
ret
}
/// Debugging function to make sure projects are being loaded correctly /// Debugging function to make sure projects are being loaded correctly
pub fn ia_debug(igloo: &Igloo) -> IglooStatus pub fn ia_debug(igloo: &Igloo) -> IglooStatus
{ {

@ -129,6 +129,14 @@ impl IglooTarget
Ok(ret_target) Ok(ret_target)
} }
// Verifies target is valid and exists within the project
// This means the target must have a folder in the targets folder
// and a <target_name>.toml
pub fn target_from_existing(prj: &IglooProject, name: String) -> Result<IglooTarget, IglooStatus>
{
}
/// Creates the target's configuration file from itself /// Creates the target's configuration file from itself
/// the target must be valid at this point or else the file will be junk /// the target must be valid at this point or else the file will be junk
pub fn generate(&self, project: &IglooProject) -> IglooStatus pub fn generate(&self, project: &IglooProject) -> IglooStatus

@ -113,7 +113,7 @@ impl Igloo
} }
IT_BUILD => IT_BUILD =>
{ {
res_err = igloo_action::ia_build(self);
} }
IT_ERASE => IT_ERASE =>
{ {

@ -64,6 +64,7 @@ pub enum IglooStatus
IS_FAILED_TO_EXTRACT_MF_VAR, IS_FAILED_TO_EXTRACT_MF_VAR,
IS_FAILED_TO_WRITE_MF_VAR, IS_FAILED_TO_WRITE_MF_VAR,
IS_FAILED_TO_CREATE_SYMLINK, IS_FAILED_TO_CREATE_SYMLINK,
IS_NOT_IGLOO_DIRECTORY,
IS_NONE, IS_NONE,
} }

@ -9,6 +9,7 @@ use igloo_util::IglooDebugSeverity::{self, *};
use igloo_util::IglooStatus::{self, *}; use igloo_util::IglooStatus::{self, *};
use igloo_util::IglooType::{self, *}; use igloo_util::IglooType::{self, *};
use igloo_util::TRACE_LEVEL; use igloo_util::TRACE_LEVEL;
fn main() fn main()
{ {
let mut ig = Igloo::new(); let mut ig = Igloo::new();

Loading…
Cancel
Save