| ## structure of the tree |
| SRC=../../.. |
| EXPORTS=$(SRC)/../exports |
| IMPORTS=$(SRC)/../imports |
| |
| ## determine the plugins to be included |
| PLUGINS = \ |
| org.eclipse.rtsc.xdctools.core \ |
| org.eclipse.rtsc.xdctools.server |
| |
| ## the manifest file for the 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)) |
| |
| ## choose the name and location of the plugin jar file |
| PLUGIN=$(EXPORTS)/$(NAME)_$(VERS) |
| |
| ## the default goal |
| default: $(PLUGIN) |
| |
| ## build the plugin |
| $(PLUGIN): clean $(MANIFEST) plugin.xml $(PLUGINS) |
| cp -r --parents $(MANIFEST) plugin.xml $(PLUGIN) |
| find $(PLUGIN) -name .svn -prune -exec rm -rf {} \; |
| |
| ## build the plugin staging dirs |
| $(PLUGINS): |
| mkdir -p $(PLUGIN)/src |
| ./mksrc.sh $(EXPORTS)/$@_$(VERS) $(SRC)/packages $(PLUGIN)/src |
| |
| ## clean up |
| clean: |
| rm -rf $(PLUGIN) |