Created
May 23, 2014 00:16
-
-
Save jannson/9c19dd0e0a8612429b0f to your computer and use it in GitHub Desktop.
package Makefile example in openwrt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#opt/openwrt/trunk-qemu/package/utils/eep | |
include $(TOPDIR)/rules.mk | |
PKG_NAME:=eep | |
PKG_VERSION:=5.0 | |
PKG_RELEASE:=1 | |
PKG_BUILD_DIR:= $(BUILD_DIR)/$(PKG_NAME) | |
include $(INCLUDE_DIR)/package.mk | |
define Package/$(PKG_NAME) | |
SECTION:=utils | |
CATEGORY:=Utilities | |
TITLE:=eep -- i2c general program | |
MAINTAINER:=handawei | |
endef | |
define Package/$(PKG_NAME)/description | |
i2c general program | |
endef | |
define Build/Prepare | |
mkdir -p $(PKG_BUILD_DIR) | |
$(CP) ./src/* $(PKG_BUILD_DIR)/ | |
endef | |
define Build/Compile | |
$(MAKE) -C $(PKG_BUILD_DIR) \ | |
$(TARGET_CONFIGURE_OPTS) CFLAGS="$(TARGET_CFLAGS) -I$(LINUX_DIR)/include" | |
endef | |
define Package/$(PKG_NAME)/install | |
$(INSTALL_DIR) $(1)/bin | |
$(INSTALL_BIN) $(PKG_BUILD_DIR)/eep $(1)/bin/ | |
endef | |
$(eval $(call BuildPackage,eep)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OBJECTS = eep | |
all : $(OBJECTS) | |
PKG_NAME=docs | |
eep: main.o | |
$(CC) $(LDFLAGS) $^ -o $@ | |
main.o: main.c | |
$(CC) $(CFLAGS) -c $< | |
.PHONY:clean | |
clean: | |
@-rm *.o eep |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment