[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Separate dirs for source (.c .java) and build files (.class .o)
From: |
Alexander Farber |
Subject: |
Re: Separate dirs for source (.c .java) and build files (.class .o) |
Date: |
Sun, 18 Dec 2005 22:58:01 +0100 |
Oops I've also noticed that I was violating Paul's rule no. 2
as I didn't have the file named $(BUILD)/'Pref$$1.class' (incl. quotes).
And thus Pref.jar was getting rebuilt every time.
So here is what I've ended up with sofar (still ugly):
CLASSES = $(CLIENT:%.java=$(BUILD)/%.class)
Pref.jar: $(MEDIA) $(CLASSES) $(BUILD)/Pref$$1.class
jar cvf $@ $(addprefix media/, $(MEDIA)) \
$(addprefix -C $(BUILD) , $(notdir $(CLASSES))) \
-C $(BUILD) 'Pref$$1.class'
$(BUILD)/Pref$$1.class: Pref.java
$(JAVAC) $(JFLAGS) -d $(dir $@) \
-classpath $(dir $@) -sourcepath $(dir $<) $<
$(BUILD)/%.class: %.java
$(JAVAC) $(JFLAGS) -d $(dir $@) \
-classpath $(dir $@) -sourcepath $(dir $<) $<