1 ifeq ($(OPENWRT_BUILD
),)
4 CFLAGS
=-Wall
-Wextra
-Wno-unused-parameter
-pedantic
5 CFLAGS
+= -Wno-unknown-warning-option
7 CFLAGS
+= -Wformat-truncation
=2
8 CFLAGS
+= -Wwrite-strings
9 CFLAGS
+= -Wnull-dereference
10 CFLAGS
+= -Wuninitialized
11 CFLAGS
+= -Wstrict-overflow
15 CFLAGS
+= -Wduplicated-branches
16 CFLAGS
+= -Wduplicated-cond
17 CFLAGS
+= -Wstrict-prototypes
18 CFLAGS
+= -Wbad-function-cast
19 CFLAGS
+= -Wold-style-definition
20 CFLAGS
+= -MMD
-O2
-I
/opt
/local
/include -g
22 LDFLAGS
:=-L
/opt
/local
/lib
23 LDLIBS
:=-lusb-1.0
-lrt
26 HMLAN_OBJS
:=hmcfgusb.o hmland.o util.o
27 HMSNIFF_OBJS
:=hmcfgusb.o hmuartlgw.o hmsniff.o
28 FLASH_HMCFGUSB_OBJS
:=hmcfgusb.o firmware.o util.o flash-hmcfgusb.o
29 FLASH_HMMODUART_OBJS
:=hmuartlgw.o firmware.o util.o flash-hmmoduart.o
30 FLASH_OTA_OBJS
:=hmcfgusb.o culfw.o hmuartlgw.o firmware.o util.o flash-ota.o hm.o aes.o
32 OBJS
:=$(HMLAN_OBJS
) $(HMSNIFF_OBJS
) $(FLASH_HMCFGUSB_OBJS
) $(FLASH_HMMODUART_OBJS
) $(FLASH_OTA_OBJS
)
34 all: hmland hmsniff flash-hmcfgusb flash-hmmoduart flash-ota
41 hmsniff
: $(HMSNIFF_OBJS
)
43 flash-hmcfgusb
: $(FLASH_HMCFGUSB_OBJS
)
45 flash-hmmoduart
: $(FLASH_HMMODUART_OBJS
)
47 flash-ota
: $(FLASH_OTA_OBJS
)
50 rm -f
$(HMLAN_OBJS
) $(HMSNIFF_OBJS
) $(FLASH_HMCFGUSB_OBJS
) $(FLASH_HMMODUART_OBJS
) $(FLASH_OTA_OBJS
) $(DEPEND
) hmland hmsniff flash-hmcfgusb flash-hmmoduart flash-ota
57 include $(TOPDIR
)/rules.mk
60 PKG_VERSION
:=$(shell grep
'VERSION' version.h | cut
-d
'"' -f
2)
62 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)
64 include $(INCLUDE_DIR
)/package.mk
66 define Package
/hmcfgusb
70 TITLE
:=HM-CFG-USB utilities
74 mkdir
-p
$(PKG_BUILD_DIR
)
75 $(CP
) .
/* $(PKG_BUILD_DIR
)/
76 $(SED
) 's/OPENWRT_BUILD/DISABLED_CHECK_FOR_OPENWRT_TO_USE_CORRECT_BLOCK_NOW/' $(PKG_BUILD_DIR
)/Makefile
79 define Package
/hmcfgusb
/install
80 $(INSTALL_DIR
) $(1)/usr
/sbin
/
81 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/hmland
$(1)/usr
/sbin
/
82 $(INSTALL_DIR
) $(1)/usr
/bin
/
83 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/hmsniff
$(1)/usr
/bin
/
84 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/flash-hmcfgusb
$(1)/usr
/bin
/
85 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/flash-ota
$(1)/usr
/bin
/
86 $(INSTALL_DIR
) $(1)/etc
/init.d
/
87 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/init.hmland.OpenWRT
$(1)/etc
/init.d
/hmland
90 define Package
/hmcfgusb
/postinst
92 # check if we are on real system
93 if
[ -z
"$${IPKG_INSTROOT}" ]; then
94 echo
"Enabling rc.d symlink for hmland"
95 /etc
/init.d
/hmland enable
100 define Package
/hmcfgusb
/prerm
102 # check if we are on real system
103 if
[ -z
"$${IPKG_INSTROOT}" ]; then
104 echo
"Removing rc.d symlink for hmland"
105 /etc
/init.d
/hmland disable
110 $(eval
$(call BuildPackage
,hmcfgusb
))