1
2
3
4
5
6
|
#include
int
main()
{
printf(
"This is my helloworld!\n"
);
return
0
;
}
|
1
2
3
4
5
6
7
8
9
|
helloworld : helloworld.o
$(CC) $(LDFLAGS) helloworld.o -o helloworld
helloworld.o : helloworld.c
$(CC) $(CFLAGS) -c helloworld.c
clean :
rm *.o helloworld
$(CC)
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
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 -- prints a snarky message
endef
define Package/helloworld/description
It's my first
package
demo.
endef
define Build/Prepare
echo
"Here is Package/Prepare"
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./src/* $(PKG_BUILD_DIR)/
endef
define Package/helloworld/install
echo
"Here is Package/install"
$(INSTALL_DIR) $(
1
)/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/helloworld $(
1
)/bin/
endef
$(eval $(call BuildPackage,helloworld))
|