| # @(#)Wrapper.gmk 1.1 97/09/07 |
| # |
| # Wrapper installation rules for tools that invoke java with a |
| # classname (eg: javac, javakey). |
| |
| |
| # Usage: |
| # Include this file in your makefile and set PROG_SH to be the |
| # tool(s) name(s). The tool should live in |
| # src/$(PLATFORM)/bin/tool.sh. For instance: |
| # |
| # include $(TOPDIR)/build/$(PLATFORM)/makefiles/Wrapper.gmk |
| # PROG_SH = javakey javakey_g |
| # |
| # Note that multiple scripts can be installed. |
| |
| |
| include $(TOPDIR)/build/$(PLATFORM)/makefiles/Defs.gmk |
| |
| # |
| # PROG_SH_* variables point to locations of the: |
| # (a) script in the distribution/build (DEST), |
| # (b) dirname for DEST (namely DESTDIR), |
| # (c) script in its source form (SRC), and |
| # (d) symlink so the tool could use .java_wrapper (LINK). |
| # |
| PROG_SH_DESTDIR = $(BINDIR)/$(ARCH)/$(TSOBJDIR) |
| PROG_SH_DEST = $(PROG_SH:%=$(PROG_SH_DESTDIR)/%) |
| PROG_SH_SRC = $(PROG_SH:%=$(PLATFORM_SRC)/bin/%.sh) |
| PROG_SH_LINK = $(PROG_SH:%=$(BINDIR)/%) |
| |
| $(PROG_SH_DESTDIR)/%: $(PLATFORM_SRC)/bin/%.sh |
| @mkdir -p $(BINDIR) |
| rm -f $@ |
| cp $< $@ |
| chmod +x $@ |
| |
| $(PROG_SH_LINK): $(BINDIR)/.java_wrapper |
| rm -f $(PROG_SH_LINK) |
| cd $(BINDIR) ; \ |
| for i in $(PROG_SH) ; do \ |
| ln -s .java_wrapper $$i ; \ |
| done |
| |
| $(BINDIR)/.java_wrapper: $(PLATFORM_SRC)/bin/java_wrapper.sh \ |
| $(PROG_SH_DESTDIR)/.extract_args |
| @mkdir -p $(BINDIR) |
| rm -f $(BINDIR)/.java_wrapper |
| cp $(PLATFORM_SRC)/bin/java_wrapper.sh $(BINDIR)/.java_wrapper |
| chmod +x $(BINDIR)/.java_wrapper |
| |
| $(PROG_SH_DESTDIR)/.extract_args: $(PLATFORM_SRC)/bin/extract_args.sh |
| @mkdir -p $(PROG_SH_DESTDIR) |
| rm -f $(PROG_SH_DESTDIR)/.extract_args |
| cp $(PLATFORM_SRC)/bin/extract_args.sh $(PROG_SH_DESTDIR)/.extract_args |
| |
| all install: $(PROG_SH_DEST) $(PROG_SH_LINK) |
| |
| clean clobber:: |
| rm -f $(PROG_SH_DEST) $(PROG_SH_LINK) |
| |