Skip to content

Make warnings if objdir and targetdir point to the same directory #726

Open
@tritao

Description

@tritao

As the title says, if objdir and targetdir point to the same directory, then we'll get some errors:

Basic.C.make:72: warning: overriding commands for target `.'
Basic.C.make:64: warning: ignoring old commands for target `.'

This makes sense if we look at the makefile:

$(TARGETDIR):
	@echo Creating $(TARGETDIR)
ifeq (posix,$(SHELLTYPE))
	$(SILENT) mkdir -p $(TARGETDIR)
else
	$(SILENT) mkdir $(subst /,\\,$(TARGETDIR))
endif

...

$(OBJDIR):
	@echo Creating $(OBJDIR)
ifeq (posix,$(SHELLTYPE))
	$(SILENT) mkdir -p $(OBJDIR)
else
	$(SILENT) mkdir $(subst /,\\,$(OBJDIR))
endif

If the directories are the same, then only one of these targets needs to be generated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions