Skip to content

Commit

Permalink
luci-common.mk: reorder some sections
Browse files Browse the repository at this point in the history
Have constant definitions at top, then helper-code and OpenWrt package related
sutff at the end.

Signed-off-by: Sven Roederer <freifunk@it-solutions.geroedel.de>
  • Loading branch information
SvenRoederer committed Mar 23, 2019
1 parent f9edb32 commit 20c5eaa
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions luci-common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ LUCI_MENU.theme=4. Themes
LUCI_MENU.proto=5. Protocols
LUCI_MENU.lib=6. Libraries

HTDOCS = /www
LUA_LIBRARYDIR = /usr/lib/lua
LUCI_LIBRARYDIR = $(LUA_LIBRARYDIR)/luci

PKG_VERSION?=$(if $(DUMP),x,$(strip $(shell \
if svn info >/dev/null 2>/dev/null; then \
revision="svn-r$$(LC_ALL=C svn info | sed -ne 's/^Revision: //p')"; \
Expand Down Expand Up @@ -70,29 +74,6 @@ PKG_GITBRANCH?=$(if $(DUMP),x,$(strip $(shell \
echo "$$variant" \
)))

PKG_RELEASE?=1
PKG_INSTALL:=$(if $(realpath src/Makefile),1)
PKG_BUILD_DEPENDS += lua/host luci-base/host LUCI_CSSTIDY:csstidy/host
PKG_CONFIG_DEPENDS += CONFIG_LUCI_SRCDIET CONFIG_LUCI_JSMIN CONFIG_LUCI_CSSTIDY

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk

HTDOCS = /www
LUA_LIBRARYDIR = /usr/lib/lua
LUCI_LIBRARYDIR = $(LUA_LIBRARYDIR)/luci

define Build/Prepare
for d in luasrc htdocs root src; do \
if [ -d ./$$$$d ]; then \
mkdir -p $(PKG_BUILD_DIR)/$$$$d; \
$(CP) ./$$$$d/* $(PKG_BUILD_DIR)/$$$$d/; \
fi; \
done
$(call Build/Prepare/Default)
endef

define SrcDiet
$(FIND) $(1) -type f -name '*.lua' | while read src; do \
if LUA_PATH="$(STAGING_DIR_HOSTPKG)/lib/lua/5.1/?.lua" luasrcdiet --noopt-binequiv -o "$$$$src.o" "$$$$src"; \
Expand Down Expand Up @@ -122,6 +103,25 @@ define SubstituteVersion
done
endef

PKG_RELEASE?=1
PKG_INSTALL:=$(if $(realpath src/Makefile),1)
PKG_BUILD_DEPENDS += lua/host luci-base/host LUCI_CSSTIDY:csstidy/host
PKG_CONFIG_DEPENDS += CONFIG_LUCI_SRCDIET CONFIG_LUCI_JSMIN CONFIG_LUCI_CSSTIDY

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk

define Build/Prepare
for d in luasrc htdocs root src; do \
if [ -d ./$$$$d ]; then \
mkdir -p $(PKG_BUILD_DIR)/$$$$d; \
$(CP) ./$$$$d/* $(PKG_BUILD_DIR)/$$$$d/; \
fi; \
done
$(call Build/Prepare/Default)
endef

define Package/$(PKG_NAME)/install
if [ -d $(PKG_BUILD_DIR)/luasrc ]; then \
$(INSTALL_DIR) $(1)$(LUCI_LIBRARYDIR); \
Expand Down

0 comments on commit 20c5eaa

Please sign in to comment.