Makefile 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. include ../../build/config.mk
  2. include ../../build/gccconfig.mk
  3. UCI_VERSION = 0.8.0
  4. #UCI_SITE = http://mirror2.openwrt.org/sources
  5. #UCI_DIR = uci-$(UCI_VERSION)
  6. #UCI_FILE = $(UCI_DIR).tar.gz
  7. #UCI_URL = $(UCI_SITE)/$(UCI_FILE)
  8. UCI_GITREV = aa3ab8012bfbf793d2884c08ea924545a04e9544
  9. UCI_SITE = http://nbd.name
  10. UCI_DIR = uci.git
  11. UCI_FILE = uci-$(UCI_VERSION)$(UCI_APPEND).tar.gz
  12. UCI_URL = $(UCI_SITE)/gitweb.cgi?p=uci.git;a=snapshot;h=$(UCI_GITREV)
  13. UCI_PATCHDIR = patches
  14. all: compile
  15. include ../../build/module.mk
  16. $(UCI_FILE):
  17. wget -O $@ "$(UCI_URL)" || rm -f $@
  18. $(UCI_DIR)/.prepared: $(UCI_FILE)
  19. rm -rf $(UCI_DIR)
  20. tar xvfz $(UCI_FILE)
  21. (cd $(UCI_PATCHDIR); ls *.patch | sort > series) || true
  22. [ -f "$(UCI_PATCHDIR)/series" ] && while read patch; do \
  23. patch -d $(UCI_DIR) -p1 < $(UCI_PATCHDIR)/$$patch; \
  24. done < $(UCI_PATCHDIR)/series || true
  25. touch $@
  26. compile: $(UCI_DIR)/.prepared
  27. $(MAKE) -C $(UCI_DIR) CC=$(CC) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" OS="$(OS)"
  28. mkdir -p dist/usr/lib dist/usr/bin
  29. $(MAKE) -C $(UCI_DIR) install DESTDIR=../dist prefix=/usr
  30. $(MAKE) -C $(UCI_DIR)/lua CC=$(CC) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" OS="$(OS)"
  31. $(MAKE) -C $(UCI_DIR)/lua install DESTDIR=../../dist luadir=$(LUA_LIBRARYDIR)
  32. compile-all: compile
  33. clean:
  34. rm -rf $(UCI_PATCHDIR)/series
  35. rm -rf $(UCI_DIR) $(UCI_FILE)