Skip to content
Advertisement

Troubles with case of files extensions on Windows

I have a makefile I use under both Linux and windows using arm-none-eabi tool chain. The project contains assembler files with either .s or .S extension depending on the need of the preprocessor.

Under Linux, the makefile rules can easily distinguish those target files and separate rules are use for each of them. No problem in this world. Under Windows, the rules I defined to treat the .S files fails to handle these files. On the other hand, my rule for .s files works well.

Error returned is :

make: Pas de règle pour fabriquer la cible « obj/secmodes.S », nécessaire pour « imgm_essProcMode.elf ». Arrêt.

No rule to build the target obj/secmode.S, required for imgm_essProcMode.elf. Stop

I don’t understand why the path of the source is incorrect : all .s, .S, .c are in “src” folder ; “obj” folder is used for generated objects… I realized windows does not care of the extension case ! This seems to confuse (gnu) make.

So my question is, can we manage .s and .S differently in a makefile executed in Windows environment ? If so, how my rules shall be modified for that ?

Here some snaps of my makefile:

AOBJ_FILES := $(addprefix obj/,$(notdir $(ASM_FILES:.s=.o)))
ASOBJ_FILES := $(addprefix obj/,$(notdir $(ASMS_FILES:.S=.o)))
ALL_OBJ_FILES := $(COBJ_FILES) $(AOBJ_FILES) $(ASOBJ_FILES) 
.../...
image : $(BINEXECUTABLE)

all : $(EXECUTABLE)

obj/%.o: src/%.S
    $(TCPREFIX)-gcc $(AOPTgcc) -Xassembler -acdghln=$(basename $@).lst -o $@ $<

obj/%.o: src/%.s
    $(TCPREFIX)-as $(AOPT) $< -o $@ -acdghln=$(basename $@).lst

obj/%.o: src/%.c
    $(TCPREFIX)-gcc $(COPT) -Wa,-acdghln=$(basename $@).lst $(DEFINES) -o $@ $<

$(EXECUTABLE): $(ALL_OBJ_FILES)
    $(TCPREFIX)-gcc $(LOPTgcc) $^ -o $@

Thank you for any hint !

Advertisement

Answer

This has nothing to do with make. As you say, it’s the operating system which doesn’t recognize the difference in case. If the filesystem doesn’t support filenames that differ only in case, then there’s nothing a program like make can do about it.

You’ll have to name your files differently in more than just case: you’ll have to use .s and .sc or something else, not .s and .S.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement