| 1 |
# Makerules |
| 2 |
#*************************************************************************** |
| 3 |
# |
| 4 |
# Java Project Makefile common rules |
| 5 |
# |
| 6 |
# (C) 1999 Jacob Dreyer - Geotechnical Software Services |
| 7 |
# [email protected] - http://geosoft.no |
| 8 |
# |
| 9 |
# Modifications Copyright (C) 2001-2007 Robert Grimm |
| 10 |
# [email protected] |
| 11 |
# |
| 12 |
# This program is free software; you can redistribute it and/or |
| 13 |
# modify it under the terms of the GNU General Public License |
| 14 |
# as published by the Free Software Foundation; either version 2 |
| 15 |
# of the License, or (at your option) any later version. |
| 16 |
# |
| 17 |
# This program is distributed in the hope that it will be useful, |
| 18 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 |
# GNU General Public License for more details. |
| 21 |
# |
| 22 |
# You should have received a copy of the GNU General Public License |
| 23 |
# along with this program; if not, write to the Free Software |
| 24 |
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 25 |
# |
| 26 |
#*************************************************************************** |
| 27 |
|
| 28 |
ifdef JAVA_DEV_ROOT |
| 29 |
include $(JAVA_DEV_ROOT)/Makebase |
| 30 |
endif |
| 31 |
|
| 32 |
#*************************************************************************** |
| 33 |
# |
| 34 |
# Rules and dependencies. |
| 35 |
# |
| 36 |
#*************************************************************************** |
| 37 |
|
| 38 |
PACKAGE_DIR = $(CLASS_DIR)/$(PACKAGE_LOC) |
| 39 |
CLASS_FILES = $(SOURCE:%.java=$(PACKAGE_DIR)/%.class) |
| 40 |
JNI_CLASS_FILES = $(JNI_SOURCE:%.java=$(PACKAGE_DIR)/%.class) |
| 41 |
JNI_HEADERS = $(JNI_SOURCE:%.java=%.h) |
| 42 |
ALL_CLASS_FILES = $(CLASS_FILES) |
| 43 |
JARFILE = $(PACKAGE_DIR).jar |
| 44 |
|
| 45 |
.PHONY : classes parsers analyzers factories jar jni clean all |
| 46 |
|
| 47 |
$(PACKAGE_DIR)/%.class : %.java |
| 48 |
$(JAVAC) $(JAVAC_OPTIONS) $< |
| 49 |
|
| 50 |
%.class : %.java |
| 51 |
$(MAKE) $(PACKAGE_DIR)/$@ |
| 52 |
|
| 53 |
$(SOURCE_DIR)/$(PACKAGE_LOC)/%.h : $(PACKAGE_DIR)/%.class |
| 54 |
$(JAVAH) $(JAVAH_OPTIONS) $(PACKAGE).$* |
| 55 |
|
| 56 |
%.h : %.class |
| 57 |
$(MAKE) $(SOURCE_DIR)/$(PACKAGE_LOC)/$@ |
| 58 |
|
| 59 |
classes: $(CLASS_FILES) |
| 60 |
|
| 61 |
parsers: |
| 62 |
|
| 63 |
analyzers: |
| 64 |
|
| 65 |
factories: |
| 66 |
|
| 67 |
$(JARFILE) : $(ALL_CLASS_FILES) |
| 68 |
$(JAR) cvf $(JARFILE) $(ALL_CLASS_FILES) $(JAR_EXTRAS) |
| 69 |
|
| 70 |
jni : $(JNI_CLASS_FILES) $(JNI_HEADERS) |
| 71 |
|
| 72 |
clean : |
| 73 |
$(RM) $(ALL_CLASS_FILES) $(JARFILE) $(JNI_HEADERS) |
| 74 |
|
| 75 |
all : classes jni rmi |