Problem compiling outside the DaisyExamples tree (SOLVED)

Hi all,

I’m currently working on a Daisy Seed-based synth project (more details once I’ve gotten everything up on github), and development-wise, things have been going well - I had everything working under vscode, including debugging under OpenOCD with the ST link Mini V3. Things have now advanced to the point where I am uploading schematics, code, Freecad files etc on to github.
As part of this process I moved the project source folder outside the DaisyExamples folder tree, and now I find I can’t compile. I have made what I thought to be the required path modifications to the project Makefile, and c_cpp_properties.json, but when I try the ‘build’ task, I get the following error:

Executing task: make clean; make

rm -fR build
make: *** No rule to make target ‘build/startup_stm32h750xx.o’, needed by ‘build/SG-2.elf’. Stop.

The Seed examples still build without issues, so i assume it is some kind of path issue, but I’m struggling to find it.

Here is the project Makefile: project folder is ~/Projects/SG-2/Firmware/v0.1, and the top of the Daisy tree is ~/Developer/Daisy/.

# Project Name
TARGET = SG-2

USE_DAISYSP_LGPL = 1

# Sources
CPP_SOURCES = SG-2.cpp

# Library Locations
LIBDAISY_DIR = ~/Developer/Daisy/libDaisy
DAISYSP_DIR = ~/Developer/Daisy/DaisySP

# Core location, and generic Makefile.
SYSTEM_FILES_DIR = $(LIBDAISY_DIR)/core
include $(SYSTEM_FILES_DIR)/Makefile

I am using VSCode 1.89.1 on Linux Mint 21.3 Virginia.
Any suggestions greatly appreciated!

OK I’ve figured it out: LIBDAISY_DIR and DAISYSP_DIR in the project Makefile must be specified with a relative path, not an absolute one.

i.e. instead of:

LIBDAISY_DIR = ~/Developer/Daisy/libDaisy
DAISYSP_DIR = ~/Developer/Daisy/DaisySP

should be:

LIBDAISY_DIR = ../../../../Developer/Daisy/libDaisy
DAISYSP_DIR = ../../../../Developer/Daisy/DaisySP

Hopefully this might help someone

Yeah, “tilde” (~) in Makefile is a trap. $(HOME) or some other environment variable can be useful if you need to refer to something outside your source tree (and it’s impractical to provide a relative path). Not sure that HOME works on Windows, though.

Why tilde is a trap? In some contexts it is expanded by make. Particularly in filenames involving wildcards. In other contexts tilde has no special meaning (it’s just the character ~).

Not all shells do tilde expansion. Bash does, but only as part of tokenization on the command line. In other contexts, tilde doesn’t have the same meaning.

So in short: ~ doesn’t expand your home directory path in your example.

Thanks Carl! Good to have an explanation. BTW, I’m looking at ‘porting’ your op6 synth engine to this project (a synth guitar that uses the softpots for pitch and string amplitudes to set the volume envelopes). Will post more details on the ‘Projects and examples’ forum soon…

2 Likes