Hi,
I finally had time to do some debugging, and was able to get my earlier
patch working for those basic cases. I've checked those changes in bzr.
The 'run' feature is associated to a target, because in a large
distribution/project, there can be multiple programs, and you probably
want to run something associated with the target you have a file open for.
In the case of the generic project/target, the target just pushes the
request up to the project which will extract a run command from the
configuration.
Good Luck.
Eric
On 11/23/2010 10:24 AM, Maximilian Matthe wrote:
> Hi,
>
> I don't see through the code of CEDET. I managed to build the
> project/target with C-c . C. When I want to run the target I get an error:
> No method definition: ede-generic-get-configuration,
> "#<ede-generic-target-c-cpp ede-generic-target-c-cpp>"
>
> There is no function definition to get the configuration of a
> generic-target. I tried to find out the configuration object of my
> target but I didnt manage to.
>
> Additionally it seems to me, that the compile and run-commands belong to
> the project rather than the target which seems a bit confusing to me:
>
> (oref (ede-current-project) config):
> [object ede-generic-config "Configuration"
> "/home/mmatthe/projects/gentest/EDEConfig.el" [object
> ede-generic-makefile-project "ede-generic-makefile-project" nil
> "gentest" "1.0" "/home/mmatthe/projects/gentest/" 937029
> "/home/mmatthe/projects/gentest/Makefile" nil nil ([object
> ede-generic-target-c-cpp "ede-generic-target-c-cpp" nil "C/C++"
> "/home/mmatthe/projects/gentest/" nil nil]) ...] "make -j2" "gdb "
> "./gentest" nil nil nil]
>
> I'm sorry for not seeing through but as I mentioned I'm not used to
> ELisp and programming in it.
>
> The state right now seems not very useful to me, unfortunately.
>
> I would really appreciate, if you could create a simple example how to
> use it.
>
> Regards, Max
>
> Am 23.11.2010 02:08, schrieb Eric M. Ludlam:
>> On 11/22/2010 09:25 AM, Maximilian Matthe wrote:
>>> Well, with the generic project I dont even get it to compile: C-c . c
>>> gives: ede-target: compile-target not supported by
>>> #<ede-generic-target-c-cpp ede-generic-target-c-cpp>
>>>
>>> Maybe if I manage to set compiling up, I can try to add another command
>>> although I have never programmed more than 10lines in ELisp.
>>>
>>> Could you give me any advice?
>>
>>
>> Hi,
>>
>> I looked through my old code, I notice that the compile and debug
>> methods were never implemented even though I had placed the right
>> configuration features in.
>>
>> The attached patch is a quick hack that adds in the features you
>> mentioned, plus the ones that should have been there. Unfortunately, I
>> don't have time to test them out much today.
>>
>> Perhaps you can try them out, and tweak them as needed. If they work,
>> let me know and we can update them.
>>
>> Templates I used to create these are from ede-proj-program, and you may
>> need to add back in some of the code I cut out when I transcribed the
>> ideas over.
>>
>> Eric
>>
>> === modified file 'ede/ede-generic.el'
>> *** ede/ede-generic.el 2010-07-25 14:12:11 +0000
>> --- ede/ede-generic.el 2010-11-23 01:04:24 +0000
>> ***************
>> *** 104,109 ****
>> --- 104,116 ----
>> :group (default build)
>> :documentation
>> "Command used for debugging this project.")
>> + (run-command :initarg :debug-command
>> + :initform nil
>> + :type (or null string)
>> + :custom string
>> + :group (default build)
>> + :documentation
>> + "Command used to run something related to this project.")
>> ;; C target customixations
>> (c-include-path :initarg :c-include-path
>> :initform nil
>> ***************
>> *** 321,326 ****
>> --- 328,369 ----
>> (config (ede-generic-get-configuration proj)))
>> (oref config c-include-path)))
>>
>> + ;;; Commands
>> + ;;
>> + (defmethod project-compile-project ((proj ede-generic-project)
>> &optional command)
>> + "Compile the entire current project PROJ.
>> + Argument COMMAND is the command to use when compiling."
>> + (let* ((config (ede-generic-get-configuration proj))
>> + (comp (oref config :build-command)))
>> + (compile comp)))
>> +
>> + (defmethod project-compile-target ((obj ede-generic-target)&optional
>> command)
>> + "Compile the current target OBJ.
>> + Argument COMMAND is the command to use for compiling the target."
>> + (project-compile-project (ede-current-project) command))
>> +
>> + (defmethod project-debug-target ((proj ede-generic-target))
>> + "Run the current project target OBJ in a debugger."
>> + (let* ((config (ede-generic-get-configuration proj))
>> + (debug (oref config :debug-command))
>> + (cmd (read-from-minibuffer
>> + "Run (like this): "
>> + debug))
>> + (cmdsplit (split-string cmd " " t))
>> + ;; @TODO - this depends on the user always typing in something good
>> + ;; like "gdb" or "dbx" which also exists as a useful Emacs command.
>> + ;; Is there a better way?
>> + (cmdsym (intern-soft (car cmdsplit))))
>> + (apply cmdsym (cdr cmdsplit))))
>> +
>> + (defmethod project-run-target ((proj ede-generic-target))
>> + "Run the current project target OBJ."
>> + (require 'ede-shell)
>> + (let* ((config (ede-generic-get-configuration proj))
>> + (run (oref config :run-command))
>> + (cmd (read-from-minibuffer "Run (like this): " run)))
>> + (ede-shell-run-something proj cmd)))
>> +
>> ;;; Customization
>> ;;
>> (defmethod ede-customize ((proj ede-generic-project))
>>
>>
>> ------------------------------------------------------------------------------
>> Increase Visibility of Your 3D Game App& Earn a Chance To Win $500!
>> Tap into the largest installed PC base& get more eyes on your game by
>> optimizing for Intel(R) Graphics Technology. Get started today with the
>> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
>> http://p.sf.net/sfu/intelisp-dev2dev
>
>
>
> ------------------------------------------------------------------------------
> Increase Visibility of Your 3D Game App& Earn a Chance To Win $500!
> Tap into the largest installed PC base& get more eyes on your game by
> optimizing for Intel(R) Graphics Technology. Get started today with the
> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
> http://p.sf.net/sfu/intelisp-dev2dev
> _______________________________________________
> Cedet-devel mailing list
> Cedet-devel@...
> https://lists.sourceforge.net/lists/listinfo/cedet-devel
>
|