Skip to content

Commit

Permalink
Update build to auto-detect OS
Browse files Browse the repository at this point in the history
  • Loading branch information
ckormanyos committed Aug 4, 2024
1 parent 5b4e45e commit a4dcd9b
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ti84-ref_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
cd build
PATH=../../sdcc-root/sdcc-4.4.0/bin:"$PATH"
sdcc -v
make TYP_OS=UNIX all
make all
echo 'build-and-verify-refapp partial verify result'
ls -la ../bin/refapp.8xp
sdcc-build-native-macos:
Expand All @@ -48,6 +48,6 @@ jobs:
run: |
cd build
sdcc -v
make TYP_OS=UNIX all
make all
echo 'build-and-verify-refapp partial verify result'
ls -la ../bin/refapp.8xp
25 changes: 17 additions & 8 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@
#
##############################################################################80

##############################################################################80
# operating system
##############################################################################80

ifeq ($(TYP_OS),)

ifeq ($(OS),Windows_NT)
TYP_OS := WIN
else
TYP_OS := NIX
endif

endif

##############################################################################80
# paths
##############################################################################80
Expand All @@ -33,16 +47,11 @@ PATH_OBJ := $(CURDIR)/obj
# tools
##############################################################################80

ifeq ($(TYP_OS),)
TYP_OS := UNIX
endif


ifeq ($(TYP_OS),WIN)
EXEEXT := .exe
endif

ifeq ($(TYP_OS),UNIX)
ifeq ($(TYP_OS),NIX)
EXEEXT :=
endif

Expand All @@ -53,7 +62,7 @@ TOOL_PREFIX := $(TOOL_PREFIX)/
GNUMAKE := $(CURDIR)/make$(EXEEXT)
endif

ifeq ($(TYP_OS),UNIX)
ifeq ($(TYP_OS),NIX)
TOOL_PREFIX :=

GNUMAKE := make
Expand All @@ -78,7 +87,7 @@ NULL_DEVICE := NUL
$(NULL_DEVICE) := NUL
endif

ifeq ($(TYP_OS),UNIX)
ifeq ($(TYP_OS),NIX)
NULL_DEVICE := /dev/null
$(NULL_DEVICE) := /dev/null
endif
Expand Down
8 changes: 4 additions & 4 deletions build/ti84-ref_app.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ti84-plus|x64'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand All @@ -49,10 +49,10 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ti84-plus|x64'">
<NMakeBuildCommandLine>make TYP_OS=WIN all</NMakeBuildCommandLine>
<NMakeBuildCommandLine>make all</NMakeBuildCommandLine>
<NMakeOutput>$(ProjectDir)..\bin\refapp.8xp</NMakeOutput>
<NMakeCleanCommandLine>make TYP_OS=WIN clean</NMakeCleanCommandLine>
<NMakeReBuildCommandLine>make TYP_OS=WIN all</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>make clean</NMakeCleanCommandLine>
<NMakeReBuildCommandLine>make all</NMakeReBuildCommandLine>
<NMakePreprocessorDefinitions>
</NMakePreprocessorDefinitions>
<NMakeIncludeSearchPath>$(ProjectDir)..\src</NMakeIncludeSearchPath>
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Then build in the command shell with:

```cmd
cd ti84-ref_app\build
make TYP_OS=WIN all
make all
```

### Build on `*nix`
Expand All @@ -120,7 +120,7 @@ Then build in the bash shell with:

```sh
cd ti84-ref_app/build
make TYP_OS=UNIX all
make all
```

## Testing and Continuous Integration
Expand Down
4 changes: 2 additions & 2 deletions src/app/app_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

void main(void)
{
// The main() subroutine initializes the needed hardware
// and controls the multitasking scheduler, which subsequently
// The main() subroutine initializes the needed hardware.
// It then launches the multitasking scheduler, which subsequently
// controls the blinky and hello-world tasks.

// Initialize the microcontroller abstraction layer peripheral
Expand Down
5 changes: 4 additions & 1 deletion src/startup/crt0.s
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
;//

; crt0.s
; Perform C-runtime startup including static initialization (i.e., of RAM: bss/data clear/init).

; Perform C-runtime startup static initialization
; including the RAM classes of bss/data clear/init.

; RAM initialization is implemented in the subroutine gsinit.
; Subsequently jump to main() and never return.

Expand Down

0 comments on commit a4dcd9b

Please sign in to comment.