| ## structure of the tree |
| SRC=../../.. |
| EXPORTS=$(SRC)/../exports |
| |
| ## the manifest file for th plugin |
| MANIFEST=META-INF/MANIFEST.MF |
| |
| ## determine the structure of the plugin from the manifest |
| ## determine the plugin name |
| NAME := $(shell sed -n '/^Bundle-SymbolicName:/{s/^[^:]*:[ \t]*//;s/;.*//;p}' $(MANIFEST)) |
| ## determine the plugin version |
| VERS := $(shell sed -n '/^Bundle-Version:/s/^.*:[ \t]*//p' $(MANIFEST)) |
| ## determine the jars to be included |
| JARS := $(shell sed -n '/\.jar/{s/\.jar.*/.jar/;s/^.*[: \t]//;p}' $(MANIFEST)) |
| |
| ## choose the name and location of the plugin jar file |
| PLUGIN=$(EXPORTS)/$(NAME)_$(VERS) |
| |
| ## the default goal |
| all: $(PLUGIN) |
| |
| ## build the plugin |
| $(PLUGIN): $(MANIFEST) $(JARS) |
| rm -rf $(PLUGIN) |
| mkdir $(PLUGIN) |
| cp -r --parent $(MANIFEST) $(JARS) $(PLUGIN) |
| find $(PLUGIN) -name .svn -prune -exec rm -rf {} \; |
| rm -f $(JARS) |
| |
| ## copy the wrapped jar files from the packages directory |
| $(JARS): % : $(SRC)/% |
| mkdir -p $(dir $@) |
| cp -f $< $@ |
| |
| ## clean up |
| clean: |
| rm -rf $(PLUGIN) |
| rm -f $(JARS) |