premake/premake-core

Broken Clean action for C# Make projects

Open

#149 opened on Jul 10, 2015

 (0 comments) (0 reactions) (0 assignees)C (651 forks)auto 404
enhancementgmakehelp wanted

Repository metrics

Stars
 (3,621 stars)
PR merge metrics
 (PR metrics pending)

Description

The clean action in the C# make backend is not implemented.

Clean:

vagrant@vagrant-ubuntu-trusty-64:/vagrant/CppSharp$ config=release_x64 make -C build/gmake/ clean
make: Entering directory `/vagrant/CppSharp/build/gmake'
make[1]: Nothing to be done for `clean'.
Cleaning Basic.Native
make[1]: Nothing to be done for `clean'.
make[1]: Nothing to be done for `clean'.
make[1]: Nothing to be done for `clean'.
make: Leaving directory `/vagrant/CppSharp/build/gmake'

After clean:

vagrant@vagrant-ubuntu-trusty-64:/vagrant/CppSharp$ ls -lh build/gmake/lib/Release_x64/*.dll
-rwxrwxrwx 1 vagrant vagrant  98K Jul 10 22:12 build/gmake/lib/Release_x64/Basic.CSharp.dll
-rwxrwxrwx 1 vagrant vagrant  16K Jul 10 22:12 build/gmake/lib/Release_x64/Basic.Tests.CSharp.dll

Checking the Premake source in make_csharp.lua reveals why:

    function make.csCleanRules(prj, toolset)
        --[[
        -- porting from 4.x
        _p('clean:')
        _p('\t@echo Cleaning %s', prj.name)
        _p('ifeq (posix,$(SHELLTYPE))')
        _p('\t$(SILENT) rm -f $(TARGETDIR)/%s.* $(COPYFILES)', target.basename)
        _p('\t$(SILENT) rm -rf $(OBJDIR)')
        _p('else')
        _p('\t$(SILENT) if exist $(subst /,\\\\,$(TARGETDIR)/%s) del $(subst /,\\\\,$(TARGETDIR)/%s.*)', target.name, target.basename)
        for target, source in pairs(cfgpairs[anycfg]) do
            _p('\t$(SILENT) if exist $(subst /,\\\\,%s) del $(subst /,\\\\,%s)', target, target)
        end
        for target, source in pairs(copypairs) do
            _p('\t$(SILENT) if exist $(subst /,\\\\,%s) del $(subst /,\\\\,%s)', target, target)
        end
        _p('\t$(SILENT) if exist $(subst /,\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\,$(OBJDIR))')
        _p('endif')
        _p('')
        --]]
    end

Contributor guide