|
| 1 | +# To use this file, run: |
| 2 | +# |
| 3 | +# $ make CONFIGURE_FLAGS="-Dplugin.path=/path/to/your/eclipse/plugins" |
| 4 | +# |
| 5 | +# For example, on Debian GNU/Linux: |
| 6 | +# |
| 7 | +# $ make CONFIGURE_FLAGS="-Dplugin.path=/usr/lib/eclipse:/usr/share/eclipse/dropins/jdt" |
| 8 | +# |
| 9 | +# You can also add e.g. "-DforceContextQualifier=none" to make the jars be |
| 10 | +# output under a stable filename. |
| 11 | +# |
| 12 | +CONFIGURE_FLAGS += |
| 13 | +CORE_FLAGS += -DjavacFailOnError=true |
| 14 | +INCUBATOR_FLAGS += -DjavacFailOnError=true -DjavacSource=1.6 -DjavacTarget=1.6 |
| 15 | + |
| 16 | +# Order is important; dependencies must go earlier. |
| 17 | +CORE_PLUGINS = net.sf.j2s.core net.sf.j2s.ajax net.sf.j2s.ui net.sf.j2s.lib |
| 18 | +INCUBATOR_PLUGINS = net.sf.j2s.ui.template.velocity net.sf.j2s.ui.cmdline |
| 19 | + |
| 20 | +BUILD_WORKSPACE := $(PWD)/autobuild |
| 21 | +ECLIPSE_ANT = eclipse -nosplash -clean \ |
| 22 | + -configuration $(BUILD_WORKSPACE)/configuration \ |
| 23 | + -user $(BUILD_WORKSPACE) \ |
| 24 | + -data $(BUILD_WORKSPACE) \ |
| 25 | + -application org.eclipse.ant.core.antRunner |
| 26 | + |
| 27 | +ECLIPSE_ANT_BUILD = $(ECLIPSE_ANT) build.update.jar |
| 28 | +ECLIPSE_ANT_CLEAN = if [ -f build.xml ]; then \ |
| 29 | + $(ECLIPSE_ANT) clean; \ |
| 30 | + rm -rf build.xml javaCompiler...args; \ |
| 31 | +fi |
| 32 | + |
| 33 | +all: build |
| 34 | + |
| 35 | +configure: |
| 36 | + $(ECLIPSE_ANT) -f configure.xml $(CONFIGURE_FLAGS) |
| 37 | + |
| 38 | +build: configure |
| 39 | + for i in $(CORE_PLUGINS:%=sources/%); do \ |
| 40 | + ( cd $$i && $(ECLIPSE_ANT_BUILD) $(CORE_FLAGS); ) \ |
| 41 | + done |
| 42 | + for i in $(INCUBATOR_PLUGINS:%=incubator/%); do \ |
| 43 | + ( cd $$i && $(ECLIPSE_ANT_BUILD) $(INCUBATOR_FLAGS); ) \ |
| 44 | + done |
| 45 | + |
| 46 | +clean: |
| 47 | + for i in $(INCUBATOR_PLUGINS:%=incubator/%); do \ |
| 48 | + ( cd $$i && $(ECLIPSE_ANT_CLEAN); ) \ |
| 49 | + done |
| 50 | + for i in $(CORE_PLUGINS:%=sources/%); do \ |
| 51 | + ( cd $$i && $(ECLIPSE_ANT_CLEAN); ) \ |
| 52 | + done |
| 53 | + rm -rf $(BUILD_WORKSPACE)/.metadata |
| 54 | + |
| 55 | +prefix ?= /usr/local |
| 56 | +datadir ?= $(prefix)/share/eclipse |
| 57 | +pluginsdir ?= $(datadir)/plugins |
| 58 | + |
| 59 | +install: |
| 60 | + test -z "$(DESTDIR)$(pluginsdir)" || mkdir -p "$(DESTDIR)$(pluginsdir)" |
| 61 | + install -t "$(DESTDIR)$(pluginsdir)" \ |
| 62 | + $(join $(CORE_PLUGINS:%=sources/%/),$(CORE_PLUGINS:%=%_2.0.0.jar)) \ |
| 63 | + $(join $(INCUBATOR_PLUGINS:%=incubator/%/),$(INCUBATOR_PLUGINS:%=%_1.0.0.*.jar)) |
| 64 | + |
| 65 | +.PHONY: all configure build clean install |
0 commit comments