Makefile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. GLUONDIR:=${CURDIR}
  2. LN_S:=ln -sf
  3. all: images
  4. include $(GLUONDIR)/builder/gluon.mk
  5. BOARD:=ar71xx
  6. PROFILES:=TLWR741
  7. null :=
  8. space := ${null} ${null}
  9. ${space} := ${space}
  10. prepared_stamp:=$(GLUON_BUILDDIR)/prepared
  11. prepare:
  12. mkdir -p $(GLUON_IMAGEDIR) $(GLUON_BUILDDIR)
  13. echo 'src packages file:../openwrt/bin/$(BOARD)/packages' > $(GLUON_BUILDDIR)/opkg-$(BOARD).conf
  14. $(LN_S) $(GLUON_BUILDERDIR)/feeds.conf $(GLUON_OPENWRTDIR)/feeds.conf
  15. $(GLUON_OPENWRTDIR)/scripts/feeds uninstall -a
  16. $(GLUON_OPENWRTDIR)/scripts/feeds update -a
  17. $(GLUON_OPENWRTDIR)/scripts/feeds install -a
  18. echo -e "CONFIG_TARGET_$(BOARD)=y\nCONFIG_TARGET_ROOTFS_JFFS2=n\n$(subst ${ },\n,$(patsubst %,CONFIG_PACKAGE_%=m,$(GLUON_PACKAGES)))" > $(GLUON_OPENWRTDIR)/.config
  19. $(MAKE) -C $(GLUON_OPENWRTDIR) defconfig prepare
  20. $(MAKE) -C $(GLUON_BUILDERDIR) kernel
  21. $(MAKE) -C $(GLUON_OPENWRTDIR) package/compile
  22. touch $(prepared_stamp)
  23. $(prepared_stamp):
  24. $(MAKE) prepare
  25. image-%: $(prepared_stamp)
  26. $(MAKE) -C $(GLUON_BUILDERDIR) image \
  27. PACKAGE_DIR=$(GLUON_OPENWRTDIR)/bin/$(BOARD)/packages \
  28. PROFILE=$(subst image-,,$@)
  29. images: $(patsubst %,image-%,$(PROFILES))
  30. clean:
  31. rm -rf $(GLUON_BUILDDIR) $(prepared_stamp)
  32. cleanall: clean
  33. $(MAKE) -C $(GLUON_OPENWRTDIR) clean
  34. .PHONY: all images prepare clean cleanall