Makefile.gcj 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # This Makefile is used when building with gcj. It is separate from
  2. # the ordinary Makefile as it does special GNU-make-specific things,
  3. # and this avoids making other builds unnecessarily ugly.
  4. # A .list file is made by split-for-gcj.sh.
  5. # It lists all the files in a given package.
  6. all_list_files := $(shell echo lists/*.list)
  7. # The corresponding stamp files.
  8. # Each .class file depends on its package's stamp file.
  9. # Each stamp file depends on the corresponding list file.
  10. # Each list file depends on the java files in its package.
  11. # This way touching a single java source will cause the minimum
  12. # number of rebuilds.
  13. all_stamp_files := $(all_list_files:.list=.stamp)
  14. # The dependency file generated by gcj.
  15. all_deps_files := $(all_list_files:.list=.deps)
  16. all: $(all_stamp_files)
  17. # Ensure this is rebuilt whenever the list of classes changes.
  18. # The list will always exist when this Makefile is used.
  19. Makefile.deps: classes
  20. $(SHELL) $(top_srcdir)/lib/split-for-gcj.sh
  21. -include Makefile.deps $(all_deps_files)
  22. ## Like GCJ but include some common flags.
  23. GCJF = $(GCJ) -fsource=1.5 -ftarget=1.5 -g -Wno-deprecated --encoding=UTF-8 \
  24. --bootclasspath '' --classpath $(compile_classpath) \
  25. -C -d .
  26. # Rule to rebuild a stamp file and update the deps file. Note that we
  27. # make the target be the stamp file. This ensures that if a needed
  28. # source is changed, this rule is re-run for the appropriate package.
  29. %.stamp: %.list
  30. $(GCJF) -MD -MF ${@:.stamp=.deps} -MT $@ -MP @$<
  31. echo timestamp > $@