Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF5 SDK build error with GCC under windows

Hello,

I am using SDK5 for my code that builds successfully under Linux, but not under windows.

The error occurs in the SDK, not in the application. I am wondering what modifications are needed to migrate from Linux to Windows, apart from editing MakeFile.Windows?

The details are as follow:

build system: Makefile + GNU tools ARM embedded, version 7.3.1

Windows 7 vs UBUNTU

MakeFile.Windows:

GNU_INSTALL_ROOT := C:/Program Files (x86)/GNU Tools ARM Embedded/7 2018-q2-update/bin/
GNU_VERSION := 7.3.1 
GNU_PREFIX := arm-none-eabi

The error shown:

Building nrf52832
C:/Aries/Ares-NRF52/nrf52832/makefile.mak:162: *** empty variable name. Stop.

The mentioned line (MakeFile.mak: 162):

$(foreach target, $(TARGETS), $(call define_target, $(target)))

And the macro that is called in the above line:

# $1 target name
define define_target
$(eval OUTPUT_FILE := $(OUTPUT_DIRECTORY)/$(strip $(1))) \
$(eval $(1): $(OUTPUT_FILE).out $(OUTPUT_FILE).hex $(OUTPUT_FILE).bin \
           ; @echo DONE $(strip $(1))) \
$(call prepare_build, $(1), $(OUTPUT_FILE).inc, $(OUTPUT_FILE).out)
endef

this macro and subsequent ones look fine, considering that it builds successfully under Linux with the same makefile and GCC version.

I have read and applied all relevant guides and I don't see what is the issue.

As for the last comment, my windows GCC builds our other projects successfully. So, the problem is not in its installation.

Thank you for any idea

Parents
  • Hi,

    Did you create your own makefile instead of using the ones we provide with the SDK? This seems like more of a GCC question than a Nordic question, but if you upload your makefil I can see if i can help you out.

    Have you checked the files for linux specific characters, or made sure there is no whitespaces, etc. that should not be there?

    Best regards,
    Jørgen

  • You can upload files in your comments from the 'Insert' menu. If you do not want the file to be shared in public, please let me know. I can then convert the case into a private case.

  • Your makefile is shorter than line 162. Did you change it? Where have you defined the variables PROJ_DIR and VARIANT on line 3?

    OUTPUT_DIRECTORY := $(PROJ_DIR)/obj/$(VARIANT)

  • Sorry, I should have mentioned that the file had been modified to hide the list of source files. The line in question is at line 111 now.

    Also, in regard to your next question, please go through these new attachments:

  • 
    all:
    
    	@make -f project.mak VARIANT=s3 ROOT_DIR=`pwd`
    
    	
    
    clean:
    
    	@make -f project.mak VARIANT=s3 ROOT_DIR=`pwd` clean
    
    	
    
    .PHONY: clean all
    
    
    # Diablo top level makefile.
    
    # Invoke using b.bat
    
    
    
    # In general, hierarchical makefile's are difficult, see: 
    
    # http://aegis.sourceforge.net/auug97.pdf ("Recursive Make Considered Harmful")
    
    # 
    
    # In this case, the dependancies are linear, i.e.
    
    # "scale" project depends on "libstdperiphusb" and "libcmisusb".
    
    # "libstdperiphusb" only depends on "libcmisusb" (and not "scale").
    
    # "libcmisusb" does not depend on the other projects.
    
    # So there are no tricky circular project dependancies.
    
    
    
    # Project must be in dependancy order:
    
    #PROJECTS = bootstrap update scale2 nrf52832
    
    PROJECTS = scale2 nrf52832
    
    
    
    # pass into make VARIANT=ew5 or VARIANT=ew6.
    
    
    
    ifeq (x,x$(strip $(VARIANT)))
    
    # by default, build s3
    
    VARIANT = s3
    
    endif
    
    
    
    # object files go here...
    
    OBJ_DIR = obj/$(VARIANT)
    
    
    
    ROOT_DIR = $(CURDIR)
    
    
    
    .PHONY: clean all info $(PROJECTS)
    
    
    
    all: info $(PROJECTS)
    
    
    
    info:
    
    	# @echo ' ' > build_log.log
    
    	@echo Running:  project.mak | tee -a build_log.log
    
    	@echo Building: $(PROJECTS) | tee -a build_log.log
    
    	@echo Root dir: $(ROOT_DIR) | tee -a build_log.log
    
    	@echo Shell path: $$PATH | tee -a build_log.log
    
    	@echo Variant: $(VARIANT) | tee -a build_log.log
    
    	@echo ' ' | tee -a build_log.log
    
    	@echo ' ' | tee -a build_log.log
    
    	@echo ' ' | tee -a build_log.log
    
    	
    
    
    
    $(PROJECTS):
    
    	@echo Building $@ | tee -a build_log.log
    
    	@mkdir -p $(ROOT_DIR)/$@/$(OBJ_DIR)
    
    	@make --no-print-directory -r -C $(ROOT_DIR)/$@/$(OBJ_DIR) \
    
    	OBJ_DIR=$(OBJ_DIR) \
    
    	ROOT_DIR=$(ROOT_DIR) \
    
    	PROJ_DIR=$(ROOT_DIR)/$@ \
    
    	VARIANT=$(VARIANT) \
    
    	-f $(ROOT_DIR)/$@/makefile.mak 2>&1 | tee -a build_log.log
    
    	@echo ' '
    
    
    
    clean: info
    
    	@echo ' '
    
    	@echo Cleaning: $(PROJECTS)
    
    	for proj in $(PROJECTS); do rm -rf $(ROOT_DIR)/$$proj/obj; done;
    
    	@echo ' '
    
    	
    
    

  • Have you tried replacing $(CURDIR) variable with an absolute path? I get the same error when trying to use this in the Makefiles in Windows.

Reply Children
No Data
Related