Dear fellows,
I need to compile this file for controlling usbrelay2
https://forum.openwrt.org/viewtopic.php … 64#p315564
It works in Ubuntu.
Anyway just to start somehow, I want to crosscompile an introductory Hello World. I have the program and Makefile, but it does not works.
I have this wifi router with openWrt Chaos Calmer:
https://wiki.openwrt.org/toh/asus/rt-n16
I downloaded 15.05 branch (Chaos Calmer) into my Lubuntu:
git clone git://git.openwrt.org/15.05/openwrt.git
etc. up to:
make menuconfig
make defconfig
make prereq
according:
https://forum.openwrt.org/viewtopic.php?id=29313
This is the program:
/*
in Ubuntu works this:
gcc -Wall hellowworld.c -o hellowworld
./hellowworld
*/
#include<stdio.h>
int main(void)
{
printf("\n Hello World \n\n");
return 0;
}
My non functional Makefile:
include $(TOPDIR)/rules.mk
PKG_NAME:=helloworld
PKG_VERSION:=1.0.0
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/helloworld-$(PKG_VERSION)
PKG_SOURCE:=helloworld-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/helloworld
PKG_MD5SUM:=9b7dc52656f5cbec846a7ba3299f73bd
PKG_CAT:=zcat
include $(INCLUDE_DIR)/package.mk
define Package/helloworld
SECTION:=base
CATEGORY:=General
TITLE:=Typical starting program "Hello World" written in C
#DESCRIPTION:=This variable is obsolete. use the Package/name/description define instead!
URL:=http://www.klimes.us/
endef
define Package/helloworld/description
This is a tutorial, how to cross compile this simple program in C for OpenWrt distribution
endef
define Build/Configure
$(call Build/Configure/Default,--with-linux-headers=$(LINUX_DIR))
endef
define Package/helloworld/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/brctl/brctl $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,helloworld))
That is all I have. Can you help me a bit. All I need is program usbrelay on command line in ssh switching on off relays over HID USB. First I want to start with simple crosscompiling C programm of Hello world then I will fight with HID USB... :-)
I will provide you any additional information needed, and of course thank you a lot your patience in replying to this obviously trivial question. :-)