packages/scpa5xx-view: use lowercase config option, use new service functions
[openwrt/svn-archive/archive.git] / skels / Makefile.template
1 #
2 # Copyright (C) 2008 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # This Makefile is a skeleton
8 #
9
10 include $(TOPDIR)/rules.mk
11
12 PKG_NAME:=
13 PKG_VERSION:=
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=
17 PKG_MD5SUM:=
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/package
22 SECTION:=net
23 CATEGORY:=Network
24 TITLE:=package
25 URL:=
26 endef
27
28 define Package/package/description
29 endef
30
31 CONFIGURE_ARGS += \
32 --enable-static \
33 --enable-shared
34
35 # If you wish to link against uclibc++ consider using the
36 # following variables :
37 CONFIGURE_VARS += \
38 CXXFLAGS="$$$$CXXFLAGS -fno-builtin -fno-rtti -nostdinc++" \
39 CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/uClibc++ -I$(LINUX_DIR)/include" \
40 LDFLAGS="$$$$LDFLAGS" \
41 LIBS="-nodefaultlibs -luClibc++ -lm -lnotimpl" \
42
43 MAKE_FLAGS += \
44 CFLAGS="$(TARGET_CFLAGS)"
45
46 define Build/Compile
47 # pass CFLAGS again to override -O2 set by configure
48 $(MAKE) -C $(PKG_BUILD_DIR) \
49 CFLAGS="$(TARGET_CFLAGS)" \
50 DESTDIR="$(PKG_INSTALL_DIR)" \
51 all install
52 endef
53
54
55 define Build/InstallDev
56 mkdir -p $(1)/usr/include/
57 $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
58 mkdir -p $(1)/usr/package
59 $(CP) $(PKG_INSTALL_DIR)/usr/package/package.{a,so*} $(1)/usr/package/
60 endef
61
62 define Build/UninstallDev
63 rm -rf $(1)/usr/include/package \
64 $(1)/usr/package/package.{a,so*}
65 endef
66
67 define Package/package/install
68 $(INSTALL_DIR) $(1)/usr/package
69 $(CP) $(PKG_INSTALL_DIR)/usr/package/package.so.* $(1)/usr/package/
70 $(INSTALL_DIR) $(1)/etc/init.d
71 $(INSTALL_BIN) ./files/package.init $(1)/etc/init.d/package
72 $(INSTALL_DIR) $(1)/etc/config/
73 $(INSTALL_CONF) $(1)/etc/config/package
74 endef
75
76 $(eval $(call BuildPackage,package))