diff --git a/.gitignore b/.gitignore index 45fa47f..d9b4d0f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,11 @@ obj # Ada Library Information *.ali +/obj/ +/bin/ +/alire/ +/config/ +/obj/ +/bin/ +/alire/ +/config/ diff --git a/alire.toml b/alire.toml new file mode 100644 index 0000000..12b6445 --- /dev/null +++ b/alire.toml @@ -0,0 +1,15 @@ +name = "hello" +description = "'Hello, world!' demonstration project" +version = "1.0.2" +tags = ["hello", "demo"] +licenses = "MIT" +website = "https://github.com/alire-project/hello" + +authors = ["Alejandro R. Mosteo"] +maintainers = ["Alejandro R. Mosteo "] +maintainers-logins = ["mosteo"] + +executables = ["hello"] + +[[depends-on]] +libhello = "^1.0" diff --git a/config/hello_config.ads b/config/hello_config.ads new file mode 100644 index 0000000..1930b45 --- /dev/null +++ b/config/hello_config.ads @@ -0,0 +1,20 @@ +-- Configuration for hello generated by Alire +pragma Restrictions (No_Elaboration_Code); +pragma Style_Checks (Off); + +package Hello_Config is + pragma Pure; + + Crate_Version : constant String := "1.0.2"; + Crate_Name : constant String := "hello"; + + Alire_Host_OS : constant String := "linux"; + + Alire_Host_Arch : constant String := "x86_64"; + + Alire_Host_Distro : constant String := "ubuntu"; + + type Build_Profile_Kind is (release, validation, development); + Build_Profile : constant Build_Profile_Kind := release; + +end Hello_Config; diff --git a/config/hello_config.gpr b/config/hello_config.gpr new file mode 100644 index 0000000..4c5133b --- /dev/null +++ b/config/hello_config.gpr @@ -0,0 +1,50 @@ +-- Configuration for hello generated by Alire +with "libhello.gpr"; +abstract project Hello_Config is + Crate_Version := "1.0.2"; + Crate_Name := "hello"; + + Alire_Host_OS := "linux"; + + Alire_Host_Arch := "x86_64"; + + Alire_Host_Distro := "ubuntu"; + Ada_Compiler_Switches := External_As_List ("ADAFLAGS", " "); + Ada_Compiler_Switches := Ada_Compiler_Switches & + ( + "-Og" -- Optimize for debug + ,"-ffunction-sections" -- Separate ELF section for each function + ,"-fdata-sections" -- Separate ELF section for each variable + ,"-g" -- Generate debug info + ,"-gnatwa" -- Enable all warnings + ,"-gnatw.X" -- Disable warnings for No_Exception_Propagation + ,"-gnatVa" -- All validity checks + ,"-gnaty3" -- Specify indentation level of 3 + ,"-gnatya" -- Check attribute casing + ,"-gnatyA" -- Use of array index numbers in array attributes + ,"-gnatyB" -- Check Boolean operators + ,"-gnatyb" -- Blanks not allowed at statement end + ,"-gnatyc" -- Check comments + ,"-gnaty-d" -- Disable check no DOS line terminators present + ,"-gnatye" -- Check end/exit labels + ,"-gnatyf" -- No form feeds or vertical tabs + ,"-gnatyh" -- No horizontal tabs + ,"-gnatyi" -- Check if-then layout + ,"-gnatyI" -- check mode IN keywords + ,"-gnatyk" -- Check keyword casing + ,"-gnatyl" -- Check layout + ,"-gnatym" -- Check maximum line length + ,"-gnatyn" -- Check casing of entities in Standard + ,"-gnatyO" -- Check that overriding subprograms are explicitly marked as such + ,"-gnatyp" -- Check pragma casing + ,"-gnatyr" -- Check identifier references casing + ,"-gnatyS" -- Check no statements after THEN/ELSE + ,"-gnatyt" -- Check token spacing + ,"-gnatyu" -- Check unnecessary blank lines + ,"-gnatyx" -- Check extra parentheses + ); + + type Build_Profile_Kind is ("release", "validation", "development"); + Build_Profile : Build_Profile_Kind := "release"; + +end Hello_Config; diff --git a/config/hello_config.h b/config/hello_config.h new file mode 100644 index 0000000..2d6091b --- /dev/null +++ b/config/hello_config.h @@ -0,0 +1,20 @@ +/* Configuration for hello generated by Alire */ +#ifndef HELLO_CONFIG_H +#define HELLO_CONFIG_H + +#define CRATE_VERSION "1.0.2" +#define CRATE_NAME "hello" + +#define ALIRE_HOST_OS "linux" + +#define ALIRE_HOST_ARCH "x86_64" + +#define ALIRE_HOST_DISTRO "ubuntu" + +#define BUILD_PROFILE_RELEASE 1 +#define BUILD_PROFILE_VALIDATION 2 +#define BUILD_PROFILE_DEVELOPMENT 3 + +#define BUILD_PROFILE 1 + +#endif diff --git a/hello.gpr b/hello.gpr index 15cb230..8ee1fd3 100644 --- a/hello.gpr +++ b/hello.gpr @@ -1,10 +1,22 @@ -with "libhello.gpr"; - +with "config/hello_config.gpr"; project Hello is - for Source_Dirs use ("src"); - for Object_Dir use "obj"; + for Source_Dirs use ("src/", "config/"); + for Object_Dir use "obj/" & Hello_Config.Build_Profile; + for Create_Missing_Dirs use "True"; + for Exec_Dir use "bin"; for Main use ("hello.adb"); -end Hello; + package Compiler is + for Default_Switches ("Ada") use Hello_Config.Ada_Compiler_Switches; + end Compiler; + + package Binder is + for Switches ("Ada") use ("-Es"); -- Symbolic traceback + end Binder; + package Install is + for Artifacts (".") use ("share"); + end Install; + +end Hello;