1 ifeq ($(OPENWRT_BUILD
),)
4 CFLAGS
=-MMD
-O2
-Wall
-I
/opt
/local
/include -g
5 LDFLAGS
=-L
/opt
/local
/lib
9 HMLAN_OBJS
=hmcfgusb.o hmland.o util.o
10 HMSNIFF_OBJS
=hmcfgusb.o hmuartlgw.o hmsniff.o
11 FLASH_HMCFGUSB_OBJS
=hmcfgusb.o firmware.o util.o flash-hmcfgusb.o
12 FLASH_OTA_OBJS
=hmcfgusb.o culfw.o hmuartlgw.o firmware.o util.o flash-ota.o hm.o aes.o
14 OBJS
=$(HMLAN_OBJS
) $(HMSNIFF_OBJS
) $(FLASH_HMCFGUSB_OBJS
) $(FLASH_OTA_OBJS
)
16 all: hmland hmsniff flash-hmcfgusb flash-ota
23 hmsniff
: $(HMSNIFF_OBJS
)
25 flash-hmcfgusb
: $(FLASH_HMCFGUSB_OBJS
)
27 flash-ota
: $(FLASH_OTA_OBJS
)
30 rm -f
$(HMLAN_OBJS
) $(HMSNIFF_OBJS
) $(FLASH_HMCFGUSB_OBJS
) $(FLASH_OTA_OBJS
) $(DEPEND
) hmland hmsniff flash-hmcfgusb flash-ota
37 include $(TOPDIR
)/rules.mk
40 PKG_VERSION
:=$(shell grep
'VERSION' version.h | cut
-d
'"' -f
2)
42 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)
44 include $(INCLUDE_DIR
)/package.mk
46 define Package
/hmcfgusb
50 TITLE
:=HM-CFG-USB utilities
54 mkdir
-p
$(PKG_BUILD_DIR
)
55 $(CP
) .
/* $(PKG_BUILD_DIR
)/
56 $(SED
) 's/OPENWRT_BUILD/DISABLED_CHECK_FOR_OPENWRT_TO_USE_CORRECT_BLOCK_NOW/' $(PKG_BUILD_DIR
)/Makefile
59 define Package
/hmcfgusb
/install
60 $(INSTALL_DIR
) $(1)/usr
/sbin
/
61 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/hmland
$(1)/usr
/sbin
/
62 $(INSTALL_DIR
) $(1)/usr
/bin
/
63 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/hmsniff
$(1)/usr
/bin
/
64 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/flash-hmcfgusb
$(1)/usr
/bin
/
65 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/flash-ota
$(1)/usr
/bin
/
66 $(INSTALL_DIR
) $(1)/etc
/init.d
/
67 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/init.hmland.OpenWRT
$(1)/etc
/init.d
/hmland
70 define Package
/hmcfgusb
/postinst
72 # check if we are on real system
73 if
[ -z
"$${IPKG_INSTROOT}" ]; then
74 echo
"Enabling rc.d symlink for hmland"
75 /etc
/init.d
/hmland enable
80 define Package
/hmcfgusb
/prerm
82 # check if we are on real system
83 if
[ -z
"$${IPKG_INSTROOT}" ]; then
84 echo
"Removing rc.d symlink for hmland"
85 /etc
/init.d
/hmland disable
90 $(eval
$(call BuildPackage
,hmcfgusb
))