unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* java and M-x compile
@ 2005-09-30  9:37 LENNART BORGMAN
  2005-09-30 11:28 ` Peter Dyballa
       [not found] ` <mailman.9226.1128080585.20277.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 10+ messages in thread
From: LENNART BORGMAN @ 2005-09-30  9:37 UTC (permalink / raw)


By default M-x compile RET runs "make -k". The emacs manual says that this should be good for most simple programs. It does not seem to be very good for a simple java program. 

At least not for me, using GNU Make 3.80 on W2k. Is there something I am missing? (Of course I can still compile java in Emacs, but could make -k work by default, or does it need a makefile?)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: java and M-x compile
  2005-09-30  9:37 LENNART BORGMAN
@ 2005-09-30 11:28 ` Peter Dyballa
  2005-09-30 11:48   ` Lennart Borgman
       [not found] ` <mailman.9226.1128080585.20277.help-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 10+ messages in thread
From: Peter Dyballa @ 2005-09-30 11:28 UTC (permalink / raw)
  Cc: help-gnu-emacs@gnu.org


Am 30.09.2005 um 11:37 schrieb LENNART BORGMAN:

> but could make -k work by default, or does it need a makefile?

make needs a makefile.

--
Greetings

   Pete

The future will be much better tomorrow.
   -- George W. Bush

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: java and M-x compile
  2005-09-30 11:28 ` Peter Dyballa
@ 2005-09-30 11:48   ` Lennart Borgman
  0 siblings, 0 replies; 10+ messages in thread
From: Lennart Borgman @ 2005-09-30 11:48 UTC (permalink / raw)
  Cc: help-gnu-emacs@gnu.org

Peter Dyballa wrote:

>
> Am 30.09.2005 um 11:37 schrieb LENNART BORGMAN:
>
>> but could make -k work by default, or does it need a makefile?
>
>
> make needs a makefile.

Thanks Pete, that seems reasonable. I do not know make very well so I 
wondered if there were some builtin defaults. This little excerpt from  
Info (emacs) Compilation made me think that:

  "For the first `M-x compile', the default
  is `make -k', which is correct most of the time for nontrivial
  programs.  (*Note Make: (make)Top.) "

What does it mean then? Of course if there is a Makefile then "make -k" 
is correct for most nontrivial programs. At least I hope so ;-)

Then for trivial programs I obviously should try something else. Even 
though it is not true it feels like I have to know more to do simple 
things...

I think I will test something like smart-compile.el or mode-compile.el 
then. Have anyone tried to compare them?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: java and M-x compile
       [not found] <mailman.9218.1128074423.20277.help-gnu-emacs@gnu.org>
@ 2005-09-30 13:07 ` kgold
  2005-09-30 15:21   ` Peter Dyballa
  2005-10-01 13:10 ` isuy
  1 sibling, 1 reply; 10+ messages in thread
From: kgold @ 2005-09-30 13:07 UTC (permalink / raw)


LENNART BORGMAN <lennart.borgman.073@student.lu.se> writes: By default
> M-x compile RET runs "make -k". The emacs manual says that this
> should be good for most simple programs. It does not seem to be very
> good for a simple java program.
> 
> At least not for me, using GNU Make 3.80 on W2k. Is there something
> I am missing? (Of course I can still compile java in Emacs, but
> could make -k work by default, or does it need a makefile?)

It might mean that make typically comes with standard defaults, so
e.g., knows to run a C compiler on .c files.

However, most users will create a custom makefile relevant to their
project.

-- 
Ken Goldman   kgold@watson.ibm.com   914-784-7646

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: java and M-x compile
  2005-09-30 13:07 ` java and M-x compile kgold
@ 2005-09-30 15:21   ` Peter Dyballa
  0 siblings, 0 replies; 10+ messages in thread
From: Peter Dyballa @ 2005-09-30 15:21 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 30.09.2005 um 13:07 schrieb kgold:

> It might mean that make typically comes with standard defaults, so
> e.g., knows to run a C compiler on .c files.
>

Even when you know how to enter a train: how will you be able to arrive 
at your target destination when you neither know it nor how many times 
and where you have to change into which other trains?

A makefile is needed!

--
Greetings

   Pete

When confronted with actual numbers, a mathematician is at a loss.  
(Steffen Hokland)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: java and M-x compile
@ 2005-09-30 22:32 Nick Roberts
  0 siblings, 0 replies; 10+ messages in thread
From: Nick Roberts @ 2005-09-30 22:32 UTC (permalink / raw)



> > It might mean that make typically comes with standard defaults, so
> > e.g., knows to run a C compiler on .c files.
> >

> Even when you know how to enter a train: how will you be able to arrive 
> at your target destination when you neither know it nor how many times 
> and where you have to change into which other trains?

> A makefile is needed!

I don't know about trains but on GNU/Linux or Unix if you type:

make myprog

and you have an executable called myprog.c in that directory, make will
find and compile it:

nickrob/34 make myprog
cc     myprog.c   -o myprog
nickrob/35

Nick

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: java and M-x compile
       [not found] <mailman.9218.1128074423.20277.help-gnu-emacs@gnu.org>
  2005-09-30 13:07 ` java and M-x compile kgold
@ 2005-10-01 13:10 ` isuy
  2005-10-01 13:14   ` isuy
  1 sibling, 1 reply; 10+ messages in thread
From: isuy @ 2005-10-01 13:10 UTC (permalink / raw)



You probably want JDEE.

http://www.jdee.sunsite.dk


LENNART BORGMAN <lennart.borgman.073@student.lu.se> writes:

> By default M-x compile RET runs "make -k". The emacs manual says that this should be good for most simple programs. It does not seem to be very good for a simple java program. 
> 
> At least not for me, using GNU Make 3.80 on W2k. Is there something I am missing? (Of course I can still compile java in Emacs, but could make -k work by default, or does it need a makefile?)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: java and M-x compile
  2005-10-01 13:10 ` isuy
@ 2005-10-01 13:14   ` isuy
  2005-10-01 14:46     ` Lennart Borgman
  0 siblings, 1 reply; 10+ messages in thread
From: isuy @ 2005-10-01 13:14 UTC (permalink / raw)



Sorry, try this instead.

http://jdee.sunsite.dk/


isuy <isuy@sbcglobal.net> writes:

> You probably want JDEE.
> 
> http://www.jdee.sunsite.dk
> 
> 
> LENNART BORGMAN <lennart.borgman.073@student.lu.se> writes:
> 
> > By default M-x compile RET runs "make -k". The emacs manual says that this should be good for most simple programs. It does not seem to be very good for a simple java program. 
> > 
> > At least not for me, using GNU Make 3.80 on W2k. Is there something I am missing? (Of course I can still compile java in Emacs, but could make -k work by default, or does it need a makefile?)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: java and M-x compile
  2005-10-01 13:14   ` isuy
@ 2005-10-01 14:46     ` Lennart Borgman
  0 siblings, 0 replies; 10+ messages in thread
From: Lennart Borgman @ 2005-10-01 14:46 UTC (permalink / raw)
  Cc: help-gnu-emacs

Oh yes, thanks, I want to use JDEE of course. I just wanted to know how 
things were supposed to work first.


isuy wrote:

>Sorry, try this instead.
>
>http://jdee.sunsite.dk/
>
>
>isuy <isuy@sbcglobal.net> writes:
>
>  
>
>>You probably want JDEE.
>>
>>http://www.jdee.sunsite.dk
>>
>>
>>LENNART BORGMAN <lennart.borgman.073@student.lu.se> writes:
>>
>>    
>>
>>>By default M-x compile RET runs "make -k". The emacs manual says that this should be good for most simple programs. It does not seem to be very good for a simple java program. 
>>>
>>>At least not for me, using GNU Make 3.80 on W2k. Is there something I am missing? (Of course I can still compile java in Emacs, but could make -k work by default, or does it need a makefile?)
>>>      
>>>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: java and M-x compile
       [not found] ` <mailman.9226.1128080585.20277.help-gnu-emacs@gnu.org>
@ 2005-10-02 11:11   ` Lee Sau Dan
  0 siblings, 0 replies; 10+ messages in thread
From: Lee Sau Dan @ 2005-10-02 11:11 UTC (permalink / raw)


>>>>> "Peter" == Peter Dyballa <Peter_Dyballa@Web.DE> writes:

    Peter> Am 30.09.2005 um 11:37 schrieb LENNART BORGMAN:

    >> but could make -k work by default, or does it need a makefile?

    Peter> make needs a makefile.

No.   GNUmake  doesn't  require  a  Makefile.  It  has  default  rules
built-in, so that it can handle the trivial cases without a Makefile.

e.g. you  have a source  file called xyz.cc  and you type  "make xyz".
GNUmake will automatically  invoke "g++ -o xyz xyz.cc"  to compile it.

Behind the scene, GNUmake applies the default rule:
        %: %.cc
        #  commands to execute (built-in):
                $(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) -o $@

where 
        LINK.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)
        CXX = g++
and all other variables that occurred above undefined.

This makes it possible  to override certain behaviours without writing
a Makefile.  e.g. "make  CXX=my_c++_compiler xyz" will compile it with
"my_c++_compiler"  instead  of "g++".   I  most  often  use "make  xyz
CXXFLAGS=-O3\  -Wall LDFLAGS=-s"  to compile  an  optimized executable
without debug symbols.

No makefiles are needed for such a simple scenario.


You can have a look at the default rule of GNUmake with "make -p -n".



-- 
Lee Sau Dan                     李守敦                          ~{@nJX6X~}

E-mail: danlee@informatik.uni-freiburg.de
Home page: http://www.informatik.uni-freiburg.de/~danlee

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-10-02 11:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.9218.1128074423.20277.help-gnu-emacs@gnu.org>
2005-09-30 13:07 ` java and M-x compile kgold
2005-09-30 15:21   ` Peter Dyballa
2005-10-01 13:10 ` isuy
2005-10-01 13:14   ` isuy
2005-10-01 14:46     ` Lennart Borgman
2005-09-30 22:32 Nick Roberts
  -- strict thread matches above, loose matches on Subject: below --
2005-09-30  9:37 LENNART BORGMAN
2005-09-30 11:28 ` Peter Dyballa
2005-09-30 11:48   ` Lennart Borgman
     [not found] ` <mailman.9226.1128080585.20277.help-gnu-emacs@gnu.org>
2005-10-02 11:11   ` Lee Sau Dan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).