summaryrefslogtreecommitdiff
path: root/libjava/classpath/lib/Makefile.gcj
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /libjava/classpath/lib/Makefile.gcj
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'libjava/classpath/lib/Makefile.gcj')
-rw-r--r--libjava/classpath/lib/Makefile.gcj37
1 files changed, 37 insertions, 0 deletions
diff --git a/libjava/classpath/lib/Makefile.gcj b/libjava/classpath/lib/Makefile.gcj
new file mode 100644
index 000000000..a7f3027ef
--- /dev/null
+++ b/libjava/classpath/lib/Makefile.gcj
@@ -0,0 +1,37 @@
+# This Makefile is used when building with gcj. It is separate from
+# the ordinary Makefile as it does special GNU-make-specific things,
+# and this avoids making other builds unnecessarily ugly.
+
+# A .list file is made by split-for-gcj.sh.
+# It lists all the files in a given package.
+all_list_files := $(shell echo lists/*.list)
+# The corresponding stamp files.
+# Each .class file depends on its package's stamp file.
+# Each stamp file depends on the corresponding list file.
+# Each list file depends on the java files in its package.
+# This way touching a single java source will cause the minimum
+# number of rebuilds.
+all_stamp_files := $(all_list_files:.list=.stamp)
+# The dependency file generated by gcj.
+all_deps_files := $(all_list_files:.list=.deps)
+
+all: $(all_stamp_files)
+
+# Ensure this is rebuilt whenever the list of classes changes.
+# The list will always exist when this Makefile is used.
+Makefile.deps: classes
+ $(SHELL) $(top_srcdir)/lib/split-for-gcj.sh
+
+-include Makefile.deps $(all_deps_files)
+
+## Like GCJ but include some common flags.
+GCJF = $(GCJ) -fsource=1.5 -ftarget=1.5 -g -Wno-deprecated --encoding=UTF-8 \
+ --bootclasspath '' --classpath $(compile_classpath) \
+ -C -d .
+
+# Rule to rebuild a stamp file and update the deps file. Note that we
+# make the target be the stamp file. This ensures that if a needed
+# source is changed, this rule is re-run for the appropriate package.
+%.stamp: %.list
+ $(GCJF) -MD -MF ${@:.stamp=.deps} -MT $@ -MP @$<
+ echo timestamp > $@