summaryrefslogtreecommitdiffstats
path: root/toolchain/libnotimpl/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'toolchain/libnotimpl/Makefile')
-rw-r--r--toolchain/libnotimpl/Makefile44
1 files changed, 24 insertions, 20 deletions
diff --git a/toolchain/libnotimpl/Makefile b/toolchain/libnotimpl/Makefile
index 86ab927c1..aae7aef34 100644
--- a/toolchain/libnotimpl/Makefile
+++ b/toolchain/libnotimpl/Makefile
@@ -1,30 +1,34 @@
include $(TOPDIR)/rules.mk
-LIBNOTIMPL_DIR:=$(TOOL_BUILD_DIR)/libnotimpl
+PKG_NAME := libnotimpl
+PKG_BUILD_DIR := $(TOOL_BUILD_DIR)/libnotimpl
-LIBNOTIMPL_SRCS+=./files/math.c
-LIBNOTIMPL_OBJS:=$(patsubst ./files/%.c,$(LIBNOTIMPL_DIR)/%.o,$(LIBNOTIMPL_SRCS))
+include $(INCLUDE_DIR)/host-build.mk
-$(LIBNOTIMPL_DIR)/.prepared:
- mkdir -p $(LIBNOTIMPL_DIR)
- touch $@
+define cc
+ $(TARGET_CC) $(TARGET_CFLAGS) -c src/$(1).c -o $(PKG_BUILD_DIR)/$(1).o
+endef
-$(LIBNOTIMPL_OBJS): $(LIBNOTIMPL_DIR)/%.o : ./files/%.c
- $(TARGET_CC) $(TARGET_CFLAGS) -c $< -o $@
+define Build/Prepare
+ rm -rf $(PKG_BUILD_DIR)
+ mkdir -p $(PKG_BUILD_DIR)
+endef
-$(LIBNOTIMPL_DIR)/libnotimpl.a: $(LIBNOTIMPL_OBJS)
- $(TARGET_CROSS)ar rc $(LIBNOTIMPL_DIR)/libnotimpl.a $(LIBNOTIMPL_OBJS)
+define Build/Compile
+ $(call cc,math)
+ $(TARGET_CROSS)ar rc $(PKG_BUILD_DIR)/libnotimpl.a $(PKG_BUILD_DIR)/*.o
+endef
-$(STAGING_DIR)/usr/lib/libnotimpl.a: $(LIBNOTIMPL_DIR)/libnotimpl.a
+define Build/Install
mkdir -p $(STAGING_DIR)/usr/lib
- $(CP) $< $@
- touch -c $@
-
-source:
-prepare: $(LIBNOTIMPL_DIR)/.prepared
-compile: $(LIBNOTIMPL_DIR)/libnotimpl.a
-install: $(STAGING_DIR)/usr/lib/libnotimpl.a
-clean: FORCE
+ $(CP) $(PKG_BUILD_DIR)/libnotimpl.a $(STAGING_DIR)/usr/lib/
+endef
+
+define Build/Clean
rm -rf \
$(STAGING_DIR)/usr/lib/libnotimpl.a \
- $(LIBNOTIMPL_DIR) \
+ $(PKG_BUILD_DIR)
+endef
+
+$(eval $(call HostBuild))
+