Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tritao opened this issue Mar 31, 2017 · 1 comment · May be fixed by #2038
Open

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

tritao opened this issue Mar 31, 2017 · 1 comment · May be fixed by #2038

Comments

@tritao
Copy link
Contributor

tritao commented Mar 31, 2017

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.

@tritao tritao changed the title Make warnings if objdir and targetdir are the same Make warnings if objdir and targetdir point to the same directory Mar 31, 2017
@thomashope
Copy link
Contributor

Was able to replicate this issue and creating a main.cpp and the following premake5.lua. Will try to post a PR soon.

local project_name = "test"

workspace (project_name)
    configurations ("Debug", "Release")
    location ("build/" .. _ACTION)

project (project_name)
    kind "ConsoleApp"
    location ("build/" .. _ACTION)
    language "C++"
    cppdialect "C++11"
    architecture "x86_64"

    files {
    	"main.cpp",
    }

    targetdir ("bin/" .. _ACTION .. "/%{cfg.buildcfg}")
    objdir ("bin/" .. _ACTION .. "/%{cfg.buildcfg}")

@thomashope thomashope linked a pull request Mar 3, 2023 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants