1 ifeq ($(OPENWRT_BUILD
),)
4 CFLAGS
=-MMD
-O2
-Wall
-I
/opt
/local
/include -g
6 LDFLAGS
=-L
/opt
/local
/lib
9 ifeq ($(firstword $(origin CC
)),default
)
13 HMLAN_OBJS
:=hmcfgusb.o hmland.o util.o
14 HMSNIFF_OBJS
:=hmcfgusb.o hmuartlgw.o hmsniff.o
15 FLASH_HMCFGUSB_OBJS
:=hmcfgusb.o firmware.o util.o flash-hmcfgusb.o
16 FLASH_HMMODUART_OBJS
:=hmuartlgw.o firmware.o util.o flash-hmmoduart.o
17 FLASH_OTA_OBJS
:=hmcfgusb.o culfw.o hmuartlgw.o firmware.o util.o flash-ota.o hm.o aes.o
19 OBJS
:=$(HMLAN_OBJS
) $(HMSNIFF_OBJS
) $(FLASH_HMCFGUSB_OBJS
) $(FLASH_HMMODUART_OBJS
) $(FLASH_OTA_OBJS
)
21 all: hmland hmsniff flash-hmcfgusb flash-hmmoduart flash-ota
28 hmsniff
: $(HMSNIFF_OBJS
)
30 flash-hmcfgusb
: $(FLASH_HMCFGUSB_OBJS
)
32 flash-hmmoduart
: $(FLASH_HMMODUART_OBJS
)
34 flash-ota
: $(FLASH_OTA_OBJS
)
37 rm -f
$(HMLAN_OBJS
) $(HMSNIFF_OBJS
) $(FLASH_HMCFGUSB_OBJS
) $(FLASH_HMMODUART_OBJS
) $(FLASH_OTA_OBJS
) $(DEPEND
) hmland hmsniff flash-hmcfgusb flash-hmmoduart flash-ota
44 include $(TOPDIR
)/rules.mk
47 PKG_VERSION
:=$(shell grep
'VERSION' version.h | cut
-d
'"' -f
2)
49 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)
51 include $(INCLUDE_DIR
)/package.mk
53 define Package
/hmcfgusb
57 TITLE
:=HM-CFG-USB utilities
61 mkdir
-p
$(PKG_BUILD_DIR
)
62 $(CP
) .
/* $(PKG_BUILD_DIR
)/
63 $(SED
) 's/OPENWRT_BUILD/DISABLED_CHECK_FOR_OPENWRT_TO_USE_CORRECT_BLOCK_NOW/' $(PKG_BUILD_DIR
)/Makefile
66 define Package
/hmcfgusb
/install
67 $(INSTALL_DIR
) $(1)/usr
/sbin
/
68 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/hmland
$(1)/usr
/sbin
/
69 $(INSTALL_DIR
) $(1)/usr
/bin
/
70 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/hmsniff
$(1)/usr
/bin
/
71 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/flash-hmcfgusb
$(1)/usr
/bin
/
72 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/flash-ota
$(1)/usr
/bin
/
73 $(INSTALL_DIR
) $(1)/etc
/init.d
/
74 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/init.hmland.OpenWRT
$(1)/etc
/init.d
/hmland
77 define Package
/hmcfgusb
/postinst
79 # check if we are on real system
80 if
[ -z
"$${IPKG_INSTROOT}" ]; then
81 echo
"Enabling rc.d symlink for hmland"
82 /etc
/init.d
/hmland enable
87 define Package
/hmcfgusb
/prerm
89 # check if we are on real system
90 if
[ -z
"$${IPKG_INSTROOT}" ]; then
91 echo
"Removing rc.d symlink for hmland"
92 /etc
/init.d
/hmland disable
97 $(eval
$(call BuildPackage
,hmcfgusb
))