Bug 76263 - Automake manager put a file in Makefile.am twice
Summary: Automake manager put a file in Makefile.am twice
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Build tools: Automake (show other bugs)
Version: 3.0.1
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: KDevelop Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-27 12:44 UTC by Martin Pärtel
Modified: 2006-10-23 14:18 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Pärtel 2004-02-27 12:44:16 UTC
Version:           3.0.1 (using KDE KDE 3.2.0)
Installed from:    Gentoo Packages
OS:          Linux

I deleted a target of my "test" subproject in the automake manager to add it again with a different type (changed "Program in bin" to "Program in noinst"). Then I added the one existing file that was in the old target to the new one and tried to compile. The compiler gave an error about main() being defined twice. The cause was this line in Makefile.am:
test_otocs_SOURCES = test-otocs.cpp test-otocs.cpp

The rest of Makefile.am looked OK.

I also added two other (new) targets in the same subproject after re-creating the first one if that matters.
Comment 1 Amilcar do Carmo Lucas 2004-02-27 13:32:46 UTC
I think the solution is to rerun configure after removing a target.
Then add as many targests as you want. Reconfigure and that's it
Comment 2 Martin Pärtel 2004-02-27 22:30:36 UTC
No, configuring didn't remove the second entry. I also tried distclean, which resulted in doing "autoconf & friends" and configure. It didn't remove the second entry.
Aren't Makefile.am-s the files one writes oneself if not using and IDE? In KDevelop 2 there was a selection to update all Makefile.am-s but I can't find it in KDevelop 3 (which is good since it should be fully automatic IMO).
Comment 3 Matt Rogers 2006-10-23 14:18:57 UTC
SVN commit 598371 by mattr:

Patch from Megan Webb to fix bug 76263:
Correctly remove files from the interal data storage of the automake
manager when removing targets.

BUG: 76263
CCMAIL: mwebb@unwired.com.au


 M  +3 -0      removetargetdlg.cpp  


--- branches/kdevelop/3.4/buildtools/autotools/removetargetdlg.cpp #598370:598371
@@ -203,6 +203,9 @@
 	// they are ignored
 	removeMap.insert ( canonname + "_SOURCES", "" );
 
+	// remove from our internal list
+	m_spitem->variables.erase(canonname+"_SOURCES");
+
 	if ( m_titem->primary == "PROGRAMS" || m_titem->primary == "LTLIBRARIES" )
 	{
 		removeMap.insert ( canonname + "_LDFLAGS", "" );