Skip to content

Commit

Permalink
Merge pull request #454 from ckormanyos/make_system_cleanups
Browse files Browse the repository at this point in the history
Fix #453 via various make system cleanups
  • Loading branch information
ckormanyos authored Dec 19, 2023
2 parents 541c199 + ba39bdb commit f5643fe
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 27 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ ref_app/ref_app.vcxproj.user
ref_app/target.vcxproj.user
ref_app/tmp/
ref_app/x64
ref_app/bin/
32 changes: 25 additions & 7 deletions ref_app/target/app/make/app_make.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,21 @@
# punctuation
# ------------------------------------------------------------------------------

DQUOTE = \"
DQUOTE := \"
$(DQUOTE) := \"

SEMICOLON := ;
$(SEMICOLON) := ;

DOLLAR := $$
$(DOLLAR) := $$

# ------------------------------------------------------------------------------
# null device
# ------------------------------------------------------------------------------

NULL_DEVICE := NUL
$(NULL_DEVICE) := NUL

# ------------------------------------------------------------------------------
# paths
Expand Down Expand Up @@ -217,7 +231,7 @@ clean_prj:
@-$(MKDIR) -p $(PATH_OBJ)
@-$(MKDIR) -p $(PATH_ERR)
@-$(MKDIR) -p $(PATH_LST)
@-$(RM) -r $(PATH_BIN) 2>NUL
@-$(RM) -r $(PATH_BIN) 2>$(NULL_DEVICE)
@-$(MKDIR) -p $(PATH_BIN)


Expand All @@ -231,10 +245,10 @@ clean_all:
@-$(MKDIR) -p $(PATH_OBJ)
@-$(MKDIR) -p $(PATH_ERR)
@-$(MKDIR) -p $(PATH_LST)
@-$(RM) -r $(PATH_OBJ) 2>NUL
@-$(RM) -r $(PATH_ERR) 2>NUL
@-$(RM) -r $(PATH_LST) 2>NUL
@-$(RM) -r $(PATH_BIN) 2>NUL
@-$(RM) -r $(PATH_OBJ) 2>$(NULL_DEVICE)
@-$(RM) -r $(PATH_ERR) 2>$(NULL_DEVICE)
@-$(RM) -r $(PATH_LST) 2>$(NULL_DEVICE)
@-$(RM) -r $(PATH_BIN) 2>$(NULL_DEVICE)
@-$(MKDIR) -p $(PATH_BIN)


Expand All @@ -244,6 +258,7 @@ clean_all:
.PHONY: version
version:
# Print the GNU make version and the compiler version
@$(ECHO)
@$(ECHO) +++ Print GNUmake version
@$(MAKE) --version
@$(ECHO)
Expand All @@ -254,11 +269,14 @@ version:
@$(ECHO) $(C_INCLUDES)
@$(ECHO)
@$(ECHO) +++ Print compiler include paths (for VisualStudio(R) browsing)
@$(ECHO) $(addsuffix ;,$(subst -I,$$\(ProjectDir\)/, $(C_INCLUDES)))
@$(ECHO) $(addsuffix $(SEMICOLON),$(subst -I,$$\(ProjectDir\)/, $(C_INCLUDES)))
@$(ECHO)
@$(ECHO) +++ Print compiler definitions
@$(ECHO) $(C_DEFINES)
@$(ECHO)
@$(ECHO) +++ Print compiler CXXFLAGS flags
@$(ECHO) $(CXXFLAGS)
@$(ECHO)


# ------------------------------------------------------------------------------
Expand Down
36 changes: 27 additions & 9 deletions ref_app/target/app/make/app_make_linux.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright Christopher Kormanyos 2007 - 2022.
# Copyright Christopher Kormanyos 2007 - 2023.
# Distributed under the Boost Software License,
# Version 1.0. (See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)
Expand All @@ -26,7 +26,21 @@
# punctuation
# ------------------------------------------------------------------------------

DQUOTE = \"
DQUOTE := \"
$(DQUOTE) := \"

SEMICOLON := ;
$(SEMICOLON) := ;

DOLLAR := $$
$(DOLLAR) := $$

# ------------------------------------------------------------------------------
# null device
# ------------------------------------------------------------------------------

NULL_DEVICE := /dev/null
$(NULL_DEVICE) := /dev/null

# ------------------------------------------------------------------------------
# paths
Expand Down Expand Up @@ -136,7 +150,7 @@ C_INCLUDES = $(TGT_INCLUDES) \
ifeq ($(WARN_FLAGS),)
WARN_FLAGS = -Wall \
-Wextra \
-pedantic \
-Wpedantic \
-Wmain \
-Wundef \
-Wconversion \
Expand Down Expand Up @@ -212,7 +226,7 @@ clean_prj:
@-$(MKDIR) -p $(PATH_OBJ)
@-$(MKDIR) -p $(PATH_ERR)
@-$(MKDIR) -p $(PATH_LST)
@-$(RM) -r $(PATH_BIN) > NUL 2> NUL
@-$(RM) -r $(PATH_BIN) 2>$(NULL_DEVICE)
@-$(MKDIR) -p $(PATH_BIN)


Expand All @@ -226,10 +240,10 @@ clean_all:
@-$(MKDIR) -p $(PATH_OBJ)
@-$(MKDIR) -p $(PATH_ERR)
@-$(MKDIR) -p $(PATH_LST)
@-$(RM) -r $(PATH_OBJ) > NUL 2> NUL
@-$(RM) -r $(PATH_ERR) > NUL 2> NUL
@-$(RM) -r $(PATH_LST) > NUL 2> NUL
@-$(RM) -r $(PATH_BIN) > NUL 2> NUL
@-$(RM) -r $(PATH_OBJ) 2>$(NULL_DEVICE)
@-$(RM) -r $(PATH_ERR) 2>$(NULL_DEVICE)
@-$(RM) -r $(PATH_LST) 2>$(NULL_DEVICE)
@-$(RM) -r $(PATH_BIN) 2>$(NULL_DEVICE)
@-$(MKDIR) -p $(PATH_BIN)


Expand All @@ -239,6 +253,7 @@ clean_all:
.PHONY: version
version:
# Print the GNU make version and the compiler version
@$(ECHO)
@$(ECHO) +++ Print GNUmake version
@$(MAKE) --version
@$(ECHO)
Expand All @@ -251,6 +266,9 @@ version:
@$(ECHO) +++ Print compiler definitions
@$(ECHO) $(C_DEFINES)
@$(ECHO)
@$(ECHO) +++ Print compiler CXXFLAGS flags
@$(ECHO) $(CXXFLAGS)
@$(ECHO)


# ------------------------------------------------------------------------------
Expand All @@ -259,7 +277,7 @@ version:
$(APP).$(TGT_SUFFIX) : $(LINKER_DEFINITION_FILE) $(FILES_O)
@-$(ECHO) +++ linking application to generate: $(APP).$(TGT_SUFFIX)
@-$(CC) $(LDFLAGS) $(FILES_O) -o $(APP).$(TGT_SUFFIX)
ifneq ($(GCC_TARGET),riscv64-unknown-elf)
ifneq ($(findstr risc,$(GCC_TARGET)),)
@-$(ECHO) +++ generating assembly list file: $(APP).lss
@-$(OBJDUMP) -h -S $(APP).$(TGT_SUFFIX) > $(APP).lss
endif
Expand Down
15 changes: 4 additions & 11 deletions ref_app/target/micros/avr/make/avr.ld
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,12 @@ SECTIONS
. = ALIGN(2);
*(.text*)
. = ALIGN(2);
*(.rodata)
. = ALIGN(2);
*(.rodata*)
. = ALIGN(2);
} > ROM

.text :
{
. = ALIGN(0x10);
} > ROM = 0xAAAA

. = 0x00800100;
. = ALIGN(2);

Expand All @@ -88,12 +87,6 @@ SECTIONS
*(.data*)
. = ALIGN(2);
KEEP (*(.data*))
*(.rodata) /* Do *NOT* move this! Include .rodata here if gcc is used with -fdata-sections. */
. = ALIGN(2);
KEEP (*(.rodata))
*(.rodata*)
. = ALIGN(2);
KEEP (*(.rodata*))
_data_end = .;
} > RAM AT > ROM

Expand Down

0 comments on commit f5643fe

Please sign in to comment.