Subversion Repositories svnkaklik

Rev

Rev 388 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 388 Rev 394
Line 1... Line 1...
1
include $(TOPDIR)/rules.mk 
1
include $(TOPDIR)/rules.mk
2
 
-
 
3
PKG_NAME:=hello
2
PKG_NAME:=hello
4
PKG_VERSION:=1.0
3
PKG_VERSION:=2.1.1
5
PKG_RELEASE:=1 
4
PKG_RELEASE:=1
-
 
5
PKG_MD5SUM:=70c9ccf9fac07f762c24f2df2290784d
-
 
6
PKG_SOURCE_URL:=ftp://ftp.cs.tu-berlin.de/pub/gnu/hello \
-
 
7
	http://mirrors.sunsite.dk/gnu/hello \
-
 
8
	http://ftp.gnu.org/gnu/hello
-
 
9
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-
 
10
PKG_CAT:=zcat
-
 
11
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
6
PKG_BUILD_DIR:=$(BUILD_DIR)/hello 
12
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
7
 
-
 
8
include $(INCLUDE_DIR)/package.mk 
13
include $(TOPDIR)/package/rules.mk
9
 
-
 
-
 
14
$(eval $(call PKG_template,HELLO,$(PKG_NAME),$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
-
 
15
$(PKG_BUILD_DIR)/.configured: $(PKG_BUILD_DIR)/.prepared
-
 
16
	(cd $(PKG_BUILD_DIR); \
-
 
17
		$(TARGET_CONFIGURE_OPTS) \
-
 
18
		CFLAGS="$(TARGET_CFLAGS)" \
-
 
19
		CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
-
 
20
		LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
10
define Package/hello
21
		./configure \
-
 
22
			CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -fno-rtti -nostdinc++" \
-
 
23
			CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
-
 
24
			LDFLAGS="-nodefaultlibs -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
-
 
25
			LIBS="-luClibc++ -lc -lm -lgcc" \
-
 
26
			--target=$(GNU_TARGET_NAME) \
-
 
27
			--host=$(GNU_TARGET_NAME) \
11
   TITLE:=Hello World
28
			--build=$(GNU_HOST_NAME) \
12
   DESCRIPTION:=\
29
			--prefix=/usr \
13
      A simple HELLO WORLD program
30
			--without-libiconv-prefix \
-
 
31
			--without-libintl-prefix \
14
endef 
32
			--disable-nls \
15
 
33
	);
16
define Build/Compile
34
	## Add software specific configurable options above
17
   $(TARGET_CC) $(TARGET_CFLAGS) -o $(PKG_BUILD_DIR)/hello main.c
35
	## See : ./configure --help
18
endef 
36
	touch $@
19
 
-
 
20
define Package/hello/install
37
$(PKG_BUILD_DIR)/.built:
-
 
38
	rm -rf $(PKG_INSTALL_DIR)
21
   $(INSTALL_DIR) $(1)/usr/bin
39
	mkdir -p $(PKG_INSTALL_DIR)/usr/bin
-
 
40
	$(MAKE) -C $(PKG_BUILD_DIR)/src \
-
 
41
		$(TARGET_CONFIGURE_OPTS) \
-
 
42
		prefix="$(PKG_INSTALL_DIR)/usr"
22
   $(INSTALL_BIN) $(PKG_BUILD_DIR)/hello.out $(1)/usr/bin/
43
	$(CC) $(PKG_BUILD_DIR)/src/hello $(PKG_INSTALL_DIR)/usr/bin
23
endef 
44
	touch $@
24
 
45
$(IPKG_HELLO):
-
 
46
	install -d -m0755 $(IDIR_HELLO)/usr/bin
-
 
47
	$(CP) $(PKG_INSTALL_DIR)/usr/bin/hello $(IDIR_HELLO)/usr/bin
-
 
48
	$(RSTRIP) $(IDIR_HELLO)
25
$(eval $(call BuildPackage,hello))
49
	$(IPKG_BUILD) $(IDIR_HELLO) $(PACKAGE_DIR)
26
 
50
mostlyclean:
-
 
51
	make -C $(PKG_BUILD_DIR) clean
-
 
52
	rm $(PKG_BUILD_DIR)/.built