Some improvements in build files.

This commit is contained in:
Sorgelig
2023-09-08 18:32:02 +08:00
parent b613044f89
commit a218675ba3
3 changed files with 15 additions and 10 deletions

View File

@@ -1,8 +1,9 @@
# makefile to fail if any command in pipe is failed.
SHELL = /bin/bash -o pipefail
# using gcc version 10.2.1
MAKEFLAGS += "-j $(shell nproc)"
# using gcc version 10.2.1
BASE = arm-none-linux-gnueabihf
CC = $(BASE)-gcc
@@ -50,6 +51,8 @@ DFLAGS = $(INCLUDE) -D_7ZIP_ST -DPACKAGE_VERSION=\"1.3.3\" -DFLAC_API_EXPORTS -D
CFLAGS = $(DFLAGS) -Wall -Wextra -Wno-strict-aliasing -Wno-stringop-overflow -Wno-stringop-truncation -Wno-format-truncation -Wno-psabi -Wno-restrict -c -O3
LFLAGS = -lc -lstdc++ -lm -lrt $(IMLIB2_LIB) -Llib/bluetooth -lbluetooth -lpthread
OUTPUT_FILTER = sed -e 's/\(.[a-zA-Z]\+\):\([0-9]\+\):\([0-9]\+\):/\1(\2,\ \3):/g'
ifeq ($(PROFILING),1)
DFLAGS += -DPROFILING
endif
@@ -68,24 +71,26 @@ clean:
%.c.o: %.c
$(Q)$(info $<)
$(Q)$(CC) $(CFLAGS) -std=gnu99 -o $@ -c $< 2>&1 | sed -e 's/\(.[a-zA-Z]\+\):\([0-9]\+\):\([0-9]\+\):/\1(\2,\ \3):/g'
$(Q)$(CC) $(CFLAGS) -std=gnu99 -o $@ -c $< 2>&1 | $(OUTPUT_FILTER)
%.cpp.o: %.cpp
$(Q)$(info $<)
$(Q)$(CC) $(CFLAGS) -std=gnu++14 -Wno-class-memaccess -o $@ -c $< 2>&1 | sed -e 's/\(.[a-zA-Z]\+\):\([0-9]\+\):\([0-9]\+\):/\1(\2,\ \3):/g'
$(Q)$(CC) $(CFLAGS) -std=gnu++14 -Wno-class-memaccess -o $@ -c $< 2>&1 | $(OUTPUT_FILTER)
%.png.o: %.png
$(Q)$(info $<)
$(Q)$(LD) -r -b binary -o $@ $< 2>&1 | sed -e 's/\(.[a-zA-Z]\+\):\([0-9]\+\):\([0-9]\+\):/\1(\2,\ \3):/g'
$(Q)$(LD) -r -b binary -o $@ $< 2>&1 | $(OUTPUT_FILTER)
ifneq ($(MAKECMDGOALS), clean)
-include $(DEP)
endif
%.c.d: %.c
$(Q)$(CC) $(DFLAGS) -MM $< -MT $@ -MT $*.c.o -MF $@ 2>&1 | sed -e 's/\(.[a-zA-Z]\+\):\([0-9]\+\):\([0-9]\+\):/\1(\2,\ \3):/g'
$(Q)$(info $< >> $@)
$(Q)$(CC) $(DFLAGS) -MM $< -MT $@ -MT $*.c.o -MF $@ 2>&1 | $(OUTPUT_FILTER)
%.cpp.d: %.cpp
$(Q)$(CC) $(DFLAGS) -MM $< -MT $@ -MT $*.cpp.o -MF $@ 2>&1 | sed -e 's/\(.[a-zA-Z]\+\):\([0-9]\+\):\([0-9]\+\):/\1(\2,\ \3):/g'
$(Q)$(info $< >> $@)
$(Q)$(CC) $(DFLAGS) -MM $< -MT $@ -MT $*.cpp.o -MF $@ 2>&1 | $(OUTPUT_FILTER)
# Ensure correct time stamp
main.cpp.o: $(filter-out main.cpp.o, $(OBJ))

View File

@@ -26,9 +26,9 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<NMakeBuildCommandLine>%systemroot%\sysnative\windowspowershell\v1.0\powershell.exe wsl bash -lic ./build.sh</NMakeBuildCommandLine>
<NMakeBuildCommandLine>wsl bash -lic ./build.sh</NMakeBuildCommandLine>
<NMakeOutput>MiSTer</NMakeOutput>
<NMakeCleanCommandLine>%systemroot%\sysnative\windowspowershell\v1.0\powershell.exe wsl bash -lic ./clean.sh</NMakeCleanCommandLine>
<NMakeCleanCommandLine>wsl bash -lic ./clean.sh</NMakeCleanCommandLine>
<NMakePreprocessorDefinitions>__arm__;__GNUC__;__USE_GNU ;_GNU_SOURCE;VDATE="000000";_FILE_OFFSET_BITS=64;_LARGEFILE64_SOURCE;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
<NMakeIncludeSearchPath>c:\Work\MiSTer\toolchain\gcc103\arm-none-linux-gnueabihf\libc\usr\include;c:\Work\MiSTer\toolchain\gcc103\lib\gcc\arm-none-linux-gnueabihf\10.3.1\include;c:\Work\MiSTer\toolchain\gcc103\arm-none-linux-gnueabihf\include\c++\10.3.1;c:\Work\MiSTer\toolchain\gcc103\arm-none-linux-gnueabihf\include\c++\10.3.1\arm-linux-gnueabihf;$(NMakeIncludeSearchPath);lib\libco;lib\miniz;lib\lodepng;lib\libchdr\include;lib\bluetooth</NMakeIncludeSearchPath>
<OutDir>$(TEMP)</OutDir>

View File

@@ -1,7 +1,5 @@
#!/bin/bash
echo "Start building..."
# create simple text file named 'host' in this folder with IP address of your MiSTer.
HOST=192.168.1.75
@@ -11,6 +9,8 @@ HOST=192.168.1.75
# so we don't need to check the exit status of every command.
set -e
set -o pipefail
echo "Start building..."
make
set +e