| 1 | ########################################################### |
|---|
| 2 | # |
|---|
| 3 | # classpath |
|---|
| 4 | # |
|---|
| 5 | ########################################################### |
|---|
| 6 | |
|---|
| 7 | # You must replace "classpath" and "CLASSPATH" with the lower case name and |
|---|
| 8 | # upper case name of your new package. Some places below will say |
|---|
| 9 | # "Do not change this" - that does not include this global change, |
|---|
| 10 | # which must always be done to ensure we have unique names. |
|---|
| 11 | |
|---|
| 12 | # |
|---|
| 13 | # CLASSPATH_VERSION, CLASSPATH_SITE and CLASSPATH_SOURCE define |
|---|
| 14 | # the upstream location of the source code for the package. |
|---|
| 15 | # CLASSPATH_DIR is the directory which is created when the source |
|---|
| 16 | # archive is unpacked. |
|---|
| 17 | # CLASSPATH_UNZIP is the command used to unzip the source. |
|---|
| 18 | # It is usually "zcat" (for .gz) or "bzcat" (for .bz2) |
|---|
| 19 | # |
|---|
| 20 | # You should change all these variables to suit your package. |
|---|
| 21 | # |
|---|
| 22 | CLASSPATH_SITE=ftp://ftp.gnu.org/gnu/classpath |
|---|
| 23 | CLASSPATH_VERSION=0.13 |
|---|
| 24 | CLASSPATH_SOURCE=classpath-$(CLASSPATH_VERSION).tar.gz |
|---|
| 25 | CLASSPATH_DIR=classpath-$(CLASSPATH_VERSION) |
|---|
| 26 | CLASSPATH_UNZIP=zcat |
|---|
| 27 | |
|---|
| 28 | # |
|---|
| 29 | # CLASSPATH_IPK_VERSION should be incremented when the ipk changes. |
|---|
| 30 | # |
|---|
| 31 | CLASSPATH_IPK_VERSION=1 |
|---|
| 32 | |
|---|
| 33 | # |
|---|
| 34 | # CLASSPATH_CONFFILES should be a list of user-editable files |
|---|
| 35 | CLASSPATH_CONFFILES=/opt/etc/classpath.conf /opt/etc/init.d/SXXclasspath |
|---|
| 36 | |
|---|
| 37 | # |
|---|
| 38 | # CLASSPATH_PATCHES should list any patches, in the the order in |
|---|
| 39 | # which they should be applied to the source code. |
|---|
| 40 | # |
|---|
| 41 | #CLASSPATH_PATCHES=$(CLASSPATH_SOURCE_DIR)/configure.patch |
|---|
| 42 | |
|---|
| 43 | # |
|---|
| 44 | # If the compilation of the package requires additional |
|---|
| 45 | # compilation or linking flags, then list them here. |
|---|
| 46 | # |
|---|
| 47 | CLASSPATH_CPPFLAGS= |
|---|
| 48 | CLASSPATH_LDFLAGS= |
|---|
| 49 | |
|---|
| 50 | # |
|---|
| 51 | # CLASSPATH_BUILD_DIR is the directory in which the build is done. |
|---|
| 52 | # CLASSPATH_SOURCE_DIR is the directory which holds all the |
|---|
| 53 | # patches and ipkg control files. |
|---|
| 54 | # CLASSPATH_IPK_DIR is the directory in which the ipk is built. |
|---|
| 55 | # CLASSPATH_IPK is the name of the resulting ipk files. |
|---|
| 56 | # |
|---|
| 57 | # You should not change any of these variables. |
|---|
| 58 | # |
|---|
| 59 | CLASSPATH_BUILD_DIR=$(BUILD_DIR)/classpath |
|---|
| 60 | CLASSPATH_SOURCE_DIR=$(SOURCE_DIR)/classpath |
|---|
| 61 | CLASSPATH_IPK_DIR=$(BUILD_DIR)/classpath-$(CLASSPATH_VERSION)-ipk |
|---|
| 62 | CLASSPATH_IPK=$(BUILD_DIR)/classpath_$(CLASSPATH_VERSION)-$(CLASSPATH_IPK_VERSION)_$(TARGET_ARCH).ipk |
|---|
| 63 | |
|---|
| 64 | # |
|---|
| 65 | # This is the dependency on the source code. If the source is missing, |
|---|
| 66 | # then it will be fetched from the site using wget. |
|---|
| 67 | # |
|---|
| 68 | $(DL_DIR)/$(CLASSPATH_SOURCE): |
|---|
| 69 | $(WGET) -P $(DL_DIR) $(CLASSPATH_SITE)/$(CLASSPATH_SOURCE) |
|---|
| 70 | |
|---|
| 71 | # |
|---|
| 72 | # The source code depends on it existing within the download directory. |
|---|
| 73 | # This target will be called by the top level Makefile to download the |
|---|
| 74 | # source code's archive (.tar.gz, .bz2, etc.) |
|---|
| 75 | # |
|---|
| 76 | classpath-source: $(DL_DIR)/$(CLASSPATH_SOURCE) $(CLASSPATH_PATCHES) |
|---|
| 77 | |
|---|
| 78 | # |
|---|
| 79 | # This target unpacks the source code in the build directory. |
|---|
| 80 | # If the source archive is not .tar.gz or .tar.bz2, then you will need |
|---|
| 81 | # to change the commands here. Patches to the source code are also |
|---|
| 82 | # applied in this target as required. |
|---|
| 83 | # |
|---|
| 84 | # This target also configures the build within the build directory. |
|---|
| 85 | # Flags such as LDFLAGS and CPPFLAGS should be passed into configure |
|---|
| 86 | # and NOT $(MAKE) below. Passing it to configure causes configure to |
|---|
| 87 | # correctly BUILD the Makefile with the right paths, where passing it |
|---|
| 88 | # to Make causes it to override the default search paths of the compiler. |
|---|
| 89 | # |
|---|
| 90 | # If the compilation of the package requires other packages to be staged |
|---|
| 91 | # first, then do that first (e.g. "$(MAKE) <bar>-stage <baz>-stage"). |
|---|
| 92 | # |
|---|
| 93 | $(CLASSPATH_BUILD_DIR)/.configured: $(DL_DIR)/$(CLASSPATH_SOURCE) $(CLASSPATH_PATCHES) |
|---|
| 94 | # $(MAKE) <bar>-stage <baz>-stage |
|---|
| 95 | rm -rf $(BUILD_DIR)/$(CLASSPATH_DIR) $(CLASSPATH_BUILD_DIR) |
|---|
| 96 | $(CLASSPATH_UNZIP) $(DL_DIR)/$(CLASSPATH_SOURCE) | tar -C $(BUILD_DIR) -xvf - |
|---|
| 97 | # cat $(CLASSPATH_PATCHES) | patch -d $(BUILD_DIR)/$(CLASSPATH_DIR) -p1 |
|---|
| 98 | mv $(BUILD_DIR)/$(CLASSPATH_DIR) $(CLASSPATH_BUILD_DIR) |
|---|
| 99 | (cd $(CLASSPATH_BUILD_DIR); \ |
|---|
| 100 | $(TARGET_CONFIGURE_OPTS) \ |
|---|
| 101 | CPPFLAGS="$(STAGING_CPPFLAGS) $(CLASSPATH_CPPFLAGS)" \ |
|---|
| 102 | LDFLAGS="$(STAGING_LDFLAGS) $(CLASSPATH_LDFLAGS)" \ |
|---|
| 103 | ./configure \ |
|---|
| 104 | --with-jikes \ |
|---|
| 105 | --with-glibj=zip \ |
|---|
| 106 | --enable-jni \ |
|---|
| 107 | --disable-gtk-peer \ |
|---|
| 108 | --build=$(GNU_HOST_NAME) \ |
|---|
| 109 | --host=$(GNU_TARGET_NAME) \ |
|---|
| 110 | --target=$(GNU_TARGET_NAME) \ |
|---|
| 111 | --prefix=/opt \ |
|---|
| 112 | --disable-nls \ |
|---|
| 113 | ) |
|---|
| 114 | touch $(CLASSPATH_BUILD_DIR)/.configured |
|---|
| 115 | |
|---|
| 116 | classpath-unpack: $(CLASSPATH_BUILD_DIR)/.configured |
|---|
| 117 | |
|---|
| 118 | # |
|---|
| 119 | # This builds the actual binary. |
|---|
| 120 | # |
|---|
| 121 | $(CLASSPATH_BUILD_DIR)/.built: $(CLASSPATH_BUILD_DIR)/.configured |
|---|
| 122 | rm -f $(CLASSPATH_BUILD_DIR)/.built |
|---|
| 123 | $(MAKE) -C $(CLASSPATH_BUILD_DIR) |
|---|
| 124 | touch $(CLASSPATH_BUILD_DIR)/.built |
|---|
| 125 | |
|---|
| 126 | # |
|---|
| 127 | # This is the build convenience target. |
|---|
| 128 | # |
|---|
| 129 | classpath: $(CLASSPATH_BUILD_DIR)/.built |
|---|
| 130 | |
|---|
| 131 | # |
|---|
| 132 | # If you are building a library, then you need to stage it too. |
|---|
| 133 | # |
|---|
| 134 | $(STAGING_DIR)/opt/lib/libclasspath.so.$(CLASSPATH_VERSION): $(CLASSPATH_BUILD_DIR)/.built |
|---|
| 135 | install -d $(STAGING_DIR)/opt/include |
|---|
| 136 | install -m 644 $(CLASSPATH_BUILD_DIR)/classpath.h $(STAGING_DIR)/opt/include |
|---|
| 137 | install -d $(STAGING_DIR)/opt/lib |
|---|
| 138 | install -m 644 $(CLASSPATH_BUILD_DIR)/libclasspath.a $(STAGING_DIR)/opt/lib |
|---|
| 139 | install -m 644 $(CLASSPATH_BUILD_DIR)/libclasspath.so.$(CLASSPATH_VERSION) $(STAGING_DIR)/opt/lib |
|---|
| 140 | cd $(STAGING_DIR)/opt/lib && ln -fs libclasspath.so.$(CLASSPATH_VERSION) libclasspath.so.1 |
|---|
| 141 | cd $(STAGING_DIR)/opt/lib && ln -fs libclasspath.so.$(CLASSPATH_VERSION) libclasspath.so |
|---|
| 142 | |
|---|
| 143 | classpath-stage: $(STAGING_DIR)/opt/lib/libclasspath.so.$(CLASSPATH_VERSION) |
|---|
| 144 | |
|---|
| 145 | # |
|---|
| 146 | # This builds the IPK file. |
|---|
| 147 | # |
|---|
| 148 | # Binaries should be installed into $(CLASSPATH_IPK_DIR)/opt/sbin or $(CLASSPATH_IPK_DIR)/opt/bin |
|---|
| 149 | # (use the location in a well-known Linux distro as a guide for choosing sbin or bin). |
|---|
| 150 | # Libraries and include files should be installed into $(CLASSPATH_IPK_DIR)/opt/{lib,include} |
|---|
| 151 | # Configuration files should be installed in $(CLASSPATH_IPK_DIR)/opt/etc/classpath/... |
|---|
| 152 | # Documentation files should be installed in $(CLASSPATH_IPK_DIR)/opt/doc/classpath/... |
|---|
| 153 | # Daemon startup scripts should be installed in $(CLASSPATH_IPK_DIR)/opt/etc/init.d/S??classpath |
|---|
| 154 | # |
|---|
| 155 | # You may need to patch your application to make it use these locations. |
|---|
| 156 | # |
|---|
| 157 | $(CLASSPATH_IPK): $(CLASSPATH_BUILD_DIR)/.built |
|---|
| 158 | rm -rf $(CLASSPATH_IPK_DIR) $(BUILD_DIR)/classpath_*_$(TARGET_ARCH).ipk |
|---|
| 159 | $(MAKE) -C $(CLASSPATH_BUILD_DIR) install prefix=$(CLASSPATH_IPK_DIR)/opt |
|---|
| 160 | $(MAKE) -C $(CLASSPATH_BUILD_DIR) install-strip prefix=$(CLASSPATH_IPK_DIR)/opt |
|---|
| 161 | install -d $(CLASSPATH_IPK_DIR)/CONTROL |
|---|
| 162 | install -m 644 $(CLASSPATH_SOURCE_DIR)/control $(CLASSPATH_IPK_DIR)/CONTROL/control |
|---|
| 163 | cd $(BUILD_DIR); $(IPKG_BUILD) $(CLASSPATH_IPK_DIR) |
|---|
| 164 | |
|---|
| 165 | # |
|---|
| 166 | # This is called from the top level makefile to create the IPK file. |
|---|
| 167 | # |
|---|
| 168 | classpath-ipk: $(CLASSPATH_IPK) |
|---|
| 169 | |
|---|
| 170 | # |
|---|
| 171 | # This is called from the top level makefile to clean all of the built files. |
|---|
| 172 | # |
|---|
| 173 | classpath-clean: |
|---|
| 174 | -$(MAKE) -C $(CLASSPATH_BUILD_DIR) clean |
|---|
| 175 | |
|---|
| 176 | # |
|---|
| 177 | # This is called from the top level makefile to clean all dynamically created |
|---|
| 178 | # directories. |
|---|
| 179 | # |
|---|
| 180 | classpath-dirclean: |
|---|
| 181 | rm -rf $(BUILD_DIR)/$(CLASSPATH_DIR) $(CLASSPATH_BUILD_DIR) $(CLASSPATH_IPK_DIR) $(CLASSPATH_IPK) |
|---|