[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: have a problem mixing Make and java.
From: |
Lawrence, Lynne |
Subject: |
RE: have a problem mixing Make and java. |
Date: |
Tue, 21 Feb 2006 12:55:30 -0500 |
> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden
> On Behalf Of richard t
> Sent: Monday, February 20, 2006 12:51 PM
> To: address@hidden
> Subject: have a problem mixing Make and java.
>
> heres a minimal version of my make file
>
> src = ./src
> obj = ./obj
> ui_c = com/rich/tool/ui/MainPanel.class
> db_c= com/rich/tool/db/Connect.class \
> com/rich/tool/db/User.class
> tl_c = com/rich/tool/Tool.class
>From the looks of your rule below, it looks like you want the .class
files to end up under $(obj). In this case, you should preface each
filename above with $(ojb) (ex. ui_c =
$(obj)/com/rich/tool/ui/MainPanel.class)
>
> classes = $(ui_c) $(db_c) $(tl_c)
>
> target: $(classes)
> echo "done"
>
> $(classes) : $(subst .class,.java,$(subst
> $(obj),$(src),$(classes)))
> javac $(JFLAGS) $(subst $(src)/,,$<)
If my assumption above is correct, try this (I have not actually run it
myself, but it should get you close):
$(classes): $(obj)/%.class: $(src)/%.java
javac $(JFLAGS) -d $(obj) $<
>
> ok the problem that I get is that the macro ($<) does
> not seem to iterate for the
> different source files and I would like to know why
> that happens, and also a problem is that when a source
> file gets changed Make doesnt seem to know that it
> needs to recompile the source for it and I would like
> to know why that is...
>
> in the gnu make user's manual you should be able to do
> something like:
>
> $(dir)/%.o : $(dir)/%.c
> $(cc) $(cflags) $<
>
> so I would think that my makefile should work. as a
> sideline note, I did make a work around for this by
> using the target macro $@ which does seem to iterate
> through the target list. Unfortunately I still have
> the problem where a modified source doesn't trigger
> make to recompile it.
>
> - richt
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
>
> _______________________________________________
> Help-make mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-make
>