-source: $(DL_DIR)/$(PKG_SOURCE)
-prepare: source
- @[ -f $(PKG_BUILD_DIR)/.prepared ] || { \
- $(CMD_TRACE) "preparing... "; \
- $(MAKE) $(PKG_BUILD_DIR)/.prepared $(MAKE_TRACE); \
- }
-
-configure: prepare
- @[ -f $(PKG_BUILD_DIR)/.configured ] || { \
- $(CMD_TRACE) "configuring... "; \
- $(MAKE) $(PKG_BUILD_DIR)/.configured $(MAKE_TRACE); \
- }
-
-compile-targets:
-compile: configure
- @$(CMD_TRACE) "compiling... "
- @$(MAKE) compile-targets $(MAKE_TRACE)
-
-install-targets:
-install:
- @$(CMD_TRACE) "installing... "
- @$(MAKE) install-targets $(MAKE_TRACE)
-
-mostlyclean:
-rebuild:
- $(CMD_TRACE) "rebuilding... "
- @-$(MAKE) mostlyclean 2>&1 >/dev/null
- if [ -f $(PKG_BUILD_DIR)/.built ]; then \
- $(MAKE) clean $(MAKE_TRACE); \
- fi
- $(MAKE) compile $(MAKE_TRACE)
+define Build/Configure/Default
+ (cd $(PKG_BUILD_DIR); \
+ [ -x configure ] && \
+ $(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ ./configure \
+ --target=$(GNU_TARGET_NAME) \
+ --host=$(GNU_TARGET_NAME) \
+ --build=$(GNU_HOST_NAME) \
+ --prefix=/usr \
+ --exec-prefix=/usr \
+ --bindir=/usr/bin \
+ --sbindir=/usr/sbin \
+ --libexecdir=/usr/lib \
+ --sysconfdir=/etc \
+ --datadir=/usr/share \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --infodir=/usr/info \
+ $(DISABLE_NLS) \
+ $(1); \
+ )
+endef
+
+define Build/Configure
+$(call Build/Configure/Default,)
+endef
+
+define Build/Compile/Default
+ $(MAKE) -C $(PKG_BUILD_DIR) \
+ CC=$(TARGET_CC) \
+ CROSS="$(TARGET_CROSS)" \
+ PREFIX="$$(IDIR_$(1))" \
+ EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
+ ARCH="$(ARCH)" \
+ DESTDIR="$$(IDIR_$(1))"
+endef