Hello Friends ,
I m having some problem while making my own package ... i started with simple package helloworld but when i installed it on my router i get the following error
root@OpenWrt:/bin# ./helloworld
./helloworld: line 1: syntax error: unexpected ")"
Also, when i was installing i didn't get Successfully terminated i.e
root@OpenWrt:/bin# opkg install helloworld_1_ar71xx.ipk
Installing helloworld (1) to root...
Configuring helloworld.
(I think i should get successfully terminated after configuring helloworld )
My router model of TP-LINK is "TL-WR941ND" and i m using Backfire 10.03.1
I m using fedora 16
uname -a
Linux localhost.localdomain 3.1.0-7.fc16.i686.PAE #1 SMP Tue Nov 1 20:53:45 UTC 2011 i686 i686 i386 GNU/Linux
I m also attaching Makefile of cross compiling helloworld.c and Makefile for compiling c file
package/helloworld/Makefile
include $(TOPDIR)/rules.mk
PKG_NAME := helloworld
PKG_RELEASE := 1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/helloworld
SECTION := utils
CATEGORY := Utilities
TITLE := Helloworld program
endef
#define Package/helloworld/description
# it is a helloworld.
#endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./src/* $(PKG_BUILD_DIR)/
endef
package/helloworld/src/helloworld.c
#include <stdio.h>
int main(void)
{
printf("Hello World ");
return 0;
}
package/helloworld/src/Makefile
helloworld: helloworld.o
$(CC) $(LDFLAGS) helloworld.o -o helloworld
helloworld.o: helloworld.c
$(CC) $(CFLAGS) -c helloworld.c
clean:
rm *.o helloworld
Thank You
(Last edited by salmanhaider5 on 26 Apr 2013, 22:49)