This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 185913 - Friend API for makefile model access
Summary: Friend API for makefile model access
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: All Unix
: P2 normal (vote)
Assignee: Alexey Vladykin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-11 13:44 UTC by smburch
Modified: 2010-05-12 13:04 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description smburch 2010-05-11 13:44:20 UTC
Hi Steve,

After studying your requirements I'd prefer to give you an API to makefile
parser and let you implement your own context menus and actions.
The API will provide makefile model: list of variable assignments, rule
definitions and include directives. It should be enough to serve the use
cases you described.

Most likely this will be a "friend API": only modules listed as "friends"
will see it. So I'll need to know the names of your modules that are going
to use makefile API.

Also I should warn you that nobody has tried to use cnd.script separate from
the rest of CND cluster. Please try to including cnd.script module into your
application suite and see how many additional C/C++ modules are brought
together with cnd.script. Will you be OK with this number, or it should be
reduced?

If you agree with the "friend makefile API + your our menus and actions"
approach, then please file a task in our BugZilla ---
http://netbeans.org/bugzilla/enter_bug.cgi?product=cnd. I'll take care of it.

Thanks,
Alexey


On 05.05.2010 23:58, Steve Burchfiel wrote:
> > Hi Alexey,
> > We exchanged emails a couple weeks ago regarding the Netbeans Makefile
> > features in 6.9. After reviewing your code and the Beta release of
> > Netbeans 6.9, we'd
> > definitely like to use your new Makefile features and possibly get an
> > API into the module. It has almost everything we need. In the
> > Netbeans 6.8 Rich-Client-Platform Application we are currently developing,
> > we recently created a feature that parses Makefiles
> > and lets the user the invoke targets via the Right-mouse menu. We are
> > now realizing that the new code we wrote for this feature
> > is redundant with yours and not as feature rich. We definitely like to
> > use your standard module if possible. I'm not exactly sure how to
> > proceed but I'll list a few of the issues we're having with your standard
> > Makefile module:
> > 
> > 1. The Makefiles we use do appear to be getting parsed correctly by your
> > tools
> > because I can see all the targets in the Navigation menu. But they're not
> > showing up in the "Make->Target..." menu. I'd like a way to a) have them
> > all
> > show up, or b) have an option to select which targets should show up in the
> > "Make->Targets" menu w/o having to type the name explicitly (error prone).
> > Since your code parses the Makefile targets, it would seem reasonable to
> > present the user with a list of target choices to add to the right-click
> > menu
> > rather than having to type in the desired additional targets.
> > 
> > 2. We make use of suffix rules a lot in our Makefiles.  Our users are
> > going to need to be able to run a specific target with a suffix. In one
> > case, we use suffix rules to indicate which tool to use for a given
> > target. For example, 'compile-*vcs*' vs 'compile*-ius'*.  It
> > would be nice if the user to select to run a target as-is or with an
> > optional suffix rule. I'm attaching a screen shot of way we currently handle
> > suffix rules in the GUI.
> > 
> > Here's an example of how we commonly code Makefiles for customers:
> > 
> > %-*vcs*:
> >     $(MAKE) SIMULATOR=*vcs* $*
> > %-*ius*:
> >     $(MAKE) SIMULATOR=*irun* $*
> > 
> > *ifneq* ($(*findstring* *vcs*, $(SIMULATOR)), )
> >     TOOL_COMPILE_ARGS  := -q -sverilog -ntb_opts dtm
> > +lint='all,noVCDE,noIRIID'
> >     TOOL_RUNTIME_ARGS   = -R +vcs+lic+wait -l simv.log +vmm_test=test123
> > $(VCS_ARGS)
> >     COVER_COMMAND      := urg -dir simv.vdb -format text; cat
> > urgReport/modinfo.txt
> >     DEBUG_COMPILE      := -debug_all -assert dve
> >     DEBUG_RUNTIME      := -debug -gui
> >     COMPILE_COMMAND    := $(SIMULATOR)
> > *endif*
> > *ifeq* ($(SIMULATOR),*irun*)
> >     TOOL_COMPILE_ARGS  := +sv -assert -nowarn PMBDVX +nccoverage+all
> > +nccoverwrite +nccovtest+test
> >     TOOL_RUNTIME_ARGS   = -covoverwrite $(IRUN_ARGS)
> >     COVER_COMMAND      := iccr ../../common/iccr_yapp.cf; cat
> > yapp*.rpt    # GUI VERSION iccr -test cov_work/design/test -GUI
> >     DEBUG_COMPILE      := -linedebug
> >     DEBUG_RUNTIME      := -gui
> >     COMPILE_COMMAND    := $(SIMULATOR) -c
> > *endif*
> > 
> > compile:
> >     $(SIM_CHECK_CMD)
> >     $(COMPILE_COMMAND) $(TOOL_COMPILE_ARGS) $(COMPILE_ARGS) $(FILES)
> > 
> > What we'd like to see in the 'Make-Target' menu is something like this:
> >   compile      // Compile with default tool
> >   compile*-vcs*  // compile with vcs
> >   compile*-ius*  // compile with ius/irun
> > 
> > 3. When I tried to run a target on a machine that doesn't have Make
> > installed, I got "MAKE FAILED" w/o any other information. Will more
> > debug info be coming?
> >  
> > 4. My preference is use your module but we could really also get further
> > benefit
> > from your code if it had APIs that would allow us to query the list of
> > targets, suffix rules,
> > variables, etc along with a way to evaluate a variable. 
> > 
> > None of these appear to be show stoppers but I'm going to play with the
> > code some more.
> >  
> > Let me know how if you think we could get any of the features listed
> > above in the
> > official 6.9 release and how you'd like to proceed. You did an
> > outstanding job by the way.
> > 
> > Thanks,
> > Steve
> > 
> > 
>>> >>> Hi Steve,
>>> >>>
>>> >>> Up to and including NetBeans 6.8 we only had a very simple makefile lexer
>>> >>> for the purpose of keyword highlighting in editor.
>>> >>>
>>> >>> For the upcoming 6.9 release I've implemented makefile target
> > navigator, and
>>> >>> added editor hyperlink (Ctrl+click) for targets, macros and includes.
> > These
>>> >>> features required significant redesign of the lexer, so now it can be
> > used
>>> >>> for real makefile parsing, not only for keyword highlighting.
>>> >>>
>>> >>> All relevant code is available in the main NetBeans repository under
>>> >>> cnd.script/src/org/netbeans/modules/cnd/makefile. It was meant for
> > internal
>>> >>> use only, so there is no public API yet. If you are interested in reusing
>>> >>> it, please let me know.
>>> >>>
>>> >>> Alexey
>>> >>>
>>> >>>
>>> >>> On 20.04.2010 23:16, Susan Morgan wrote:
>>> >>>  
>>>> >>>> Hi Alexey,
>>>> >>>> Can you make a recommendation for this developer?
>>>> >>>>
>>>> >>>> Susan
>>>> >>>>
>>>> >>>>
>>>> >>>> -------- Original Message --------
>>>> >>>> Subject: Netbeans Makefile Editor
>>>> >>>> Date: Tue, 20 Apr 2010 13:53:50 -0500
>>>> >>>> From: Steve Burchfiel <steveb@severity1.com
> > <mailto:steveb@severity1.com>>
>>>> >>>> To: susan.morgan@sun.com <mailto:susan.morgan@sun.com>
>>>> >>>>
>>>> >>>> Hi Susan,
>>>> >>>> I noticed you own the Netbeans page that describes the C/C++ Makefile 
>>>> >>>> dependency features in Netbeans:
> > http://netbeans.org/kb/docs/cnd/depchecking.html
>>>> >>>> . We're in the process of adding Netbeans support for a new language. 
>>>> >>>> We'd like add a Makefile editor to our Netbeans Platform Application 
>>>> >>>> as well as some features that require us to know the targets, 
>>>> >>>> variables, etc in Makfiles (on disk and/or part of a Project). Are 
>>>> >>>> there any existing Netbeans modules along with an API and base classes 
>>>> >>>> that we can build on? If found a Makefile parser on source forge but 
>>>> >>>> I'd prefer to use code already built into the Netbeans. Any 
>>>> >>>> recommendations would be appreciated.
>>>> >>>>
>>>> >>>> Steve
>>>> >>>>    
>> >>
Comment 1 Alexey Vladykin 2010-05-11 15:24:06 UTC
Changeset: http://hg.netbeans.org/cnd-main/rev/a7275b09a4e7

The classes for makefile model access are ready. They live in org.netbeans.modules.cnd.api.makefile package of the cnd.script module. Please review.

The package is not open yet. I need to know code-name-base of your module(s) that is (are) going to use the API. Then I'll add your modules as friends and open the package to friends.

I'm not planning any extra API for custom actions and menus. Everything is in place in the NetBeans platform. You can arbitrarily change actions/menus using the XML layer. E.g. context menu actions are in Loaders/text/x-make/Actions.
Comment 2 smburch 2010-05-11 15:41:32 UTC
I knew I forgot something, the package name for the friend api is com.severity1.makefilemodule.
Comment 3 Alexey Vladykin 2010-05-11 15:57:05 UTC
Added com.severity1.makefilemodule as friend.
Changeset http://hg.netbeans.org/cnd-main/rev/c086f5d7f61a
Comment 4 Alexey Vladykin 2010-05-12 13:04:12 UTC
Closing as fixed.
If you see significant problems with the API, please reopen this request.
If you have minor comments/suggestions, please file them as new requests.