diff -Nur package/bla/Makefile package/roundf/Makefile --- package/bla/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ package/roundf/Makefile 2007-10-06 02:44:00.000000000 +0200 @@ -0,0 +1,38 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=roundf +PKG_VERSION:=0.0.0 +PKG_RELEASE:=1 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +define Package/roundf + SECTION:=utils + CATEGORY:=Utilities + TITLE:=just some code for testing if roundf is there and working + DEPENDS:= + DESCRIPTION:=see title + URL:= + VERSION:=1 +endef + +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) + $(CP) ./src/* $(PKG_BUILD_DIR)/ +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + LDFLAGS="-lm" +endef + +define Package/roundf/install + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/roundf-test $(1)/sbin/ +endef + +$(eval $(call BuildPackage,roundf)) diff -Nur package/bla/src/Makefile package/roundf/src/Makefile --- package/bla/src/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ package/roundf/src/Makefile 2007-10-06 02:42:13.000000000 +0200 @@ -0,0 +1,7 @@ +all: roundf-test + +%.o: %.c + $(CC) -lm -I. $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $^ + +clean: + rm -f *.o roudf-test diff -Nur package/bla/src/roundf-test.c package/roundf/src/roundf-test.c --- package/bla/src/roundf-test.c 1970-01-01 01:00:00.000000000 +0100 +++ package/roundf/src/roundf-test.c 2007-10-06 02:30:36.000000000 +0200 @@ -0,0 +1,13 @@ +#include +#include + +int main(int argc, char** argv) +{ + float conv, temp; + scanf("%f",&temp); + printf("Tensao => \"%f\"\n", temp); + conv = temp * (17.650862069); + conv = roundf(conv); + + printf("Convertido => \"%f\"\n", conv); +}