1

I've been trying to compile a project using the Windows command window and the gnu compiler. I've got this error:

  ../../../../make/compiler_rules.mk:40: *** multiple target patterns.  Stop.

Here is the lines 29 to 45 of the makefile:

    #----------------------------------------------------------------------*
#### Compilation rules. ASM files.
#----------------------------------------------------------------------*
$(OBJ_DIR)/%.s.o: $(A_DIR)/%.s $(OIL_OUTPUTS)
    @if [ ! -d $(OBJ_DIR) ]; 
    then mkdir -p $(OBJ_DIR); 
    fi;
    $(AS) $(ASFLAGS) $< -o $@

$(OBJ_DIR)/%.S.i: $(A_DIR)/%.S $(OIL_OUTPUTS)
    @if [ ! -d $(OBJ_DIR) ]; then mkdir -p $(OBJ_DIR); fi;
    $(CPP) $(CPPFLAGS) $< -o $@

$(OBJ_DIR)/%.S.o: $(OBJ_DIR)/%.S.i $(OIL_OUTPUTS)
    @if [ ! -d $(OBJ_DIR) ]; then mkdir -p $(OBJ_DIR); fi;
    $(AS) $(ASFLAGS) $< -o $@

I've understood through some previous posts here that it's due to whethere spaces or colons in tha names of files or directories. I've checked and ther is none. What could it be?

Zohra-tl
  • 53
  • 9
  • Post the 5-10 lines above that line as well (for context). Was that makefile hand-written or automatically generated? – Etan Reisner Sep 05 '14 at 16:22
  • I've edited the question and posted more lines of the makefile. The makefile is hand-written but not by me. – Zohra-tl Sep 05 '14 at 16:31
  • I don't see anything wrong there (other than that it looks like you might have split that first `@if` line by accident when you were pasting it). If it is split like that in the original makefile that's odd. – Etan Reisner Sep 05 '14 at 16:37
  • No it's not split in the original file. I looked through the paths also to see if there's anything wrong but everything seems ok! – Zohra-tl Sep 05 '14 at 16:39
  • What is the value of `$(OBJ_DIR)`? What is the value of `$(OIL_OUTPUTS)`? Can you link to a webpage for this software? What version of make? – Etan Reisner Sep 05 '14 at 16:45
  • $(OBJ_DIR) is C:\trunktrampoline\trampoline\examples\Thumb2\CortexM4\Tasks\Obj $(OIL_OUTPUTS) is C:\trunktrampoline\trampoline\examples\Thumb2\CortexM4\Tasks\Out The software is an RTOS called Trampoline: http://trampoline.rts-software.org/spip.php?article18 – Zohra-tl Sep 05 '14 at 16:47
  • The make version is "GNU Make 3.81" – Zohra-tl Sep 05 '14 at 16:56
  • That value for `OIL_OUTPUTS) looks odd from what I'm looking at but then again I don't see a `CortexM4` directory at all (but maybe you are adding that). Neither of those things should be material here though. (I also don't see `$(CPP)` being used in that middle rule here but again *shrug*.) I don't see any issues with those lines at the moment. – Etan Reisner Sep 05 '14 at 17:02
  • I don't know for sure, but I wonder if it is a [case-sensitivity-in-windows-file-system](http://stackoverflow.com/questions/7199039/file-paths-in-windows-environment-case-sensitive) thing. If we are not case sensitive, then the `$(OBJ_DIR)/%.s.o` and `$(OBJ_DIR)/%.S.o` do indeed collide. Not sure how make under windows deals with this though. – Digital Trauma Sep 05 '14 at 17:23

1 Answers1

2

This is not a full answer, but hopefully it helps figure out whats going on. I created the following Makefile:

all: a.txt a.TXT
%.TXT:
    echo HELLO > $@
%.txt:
    echo hello > $@

When I run make for this file under Linux, then the a.txt and a.TXT targets are treated separately, i.e. they both get built.

However if I copy this to my ancient windows XP VM, and run it with the gnuwin32 make distribution, it appears to treat a.txt and a.TXT as the same thing - specifically only one gets build. This is not exactly the same behavior you see with your $(OBJ_DIR)/%.s.o and $(OBJ_DIR)/%.S.o, but significantly it is different to the Linux behavior, so I believe this is due to case treatment, and how this particular distribution of deals with it. Is this the same distribution you are using? (version 3.81)

So, I'm sorry I can't propose a fix right now, but I think you'd probably have to share more/all of your makefile (and supporting .mk files), along with which targets are required to be built.

Community
  • 1
  • 1
Digital Trauma
  • 15,475
  • 3
  • 51
  • 83
  • Thnk you anyway. Actually, I can't share all of the targets and makefiles because this makefile compile the entire OS. The link I shared previously [http://trampoline.rts-software.org/spip.php?article18] enables you to access the repository. In the other hand, I am using the 3.81 version of make. – Zohra-tl Sep 08 '14 at 07:20
  • I tried to build the system for a different application and different traget but in vain. Could it be a due to me using MinGW? – Zohra-tl Sep 08 '14 at 11:00