Changeset 500


Ignore:
Timestamp:
Nov 22, 2012, 11:09:57 PM (7 years ago)
Author:
amain
Message:

plugin: plugins now are mutual exclusive; plugins provide a new target, and only one target can be active at the some moment

Location:
branches/contrib
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/contrib/Config.in

    r490 r500  
    4747mainmenu "DebWrt Configuration"
    4848
     49source "config/openwrt_version.in"
     50source "config/openwrt_extra.in"
     51
    4952source "config/plugin.in"
    5053
     
    5457source "config/image_name.in"
    5558source "config/flash_ip.in"
    56 
    57 source "config/openwrt_version.in"
    58 source "config/openwrt_extra.in"
    5959
    6060source "config/kernel_version.in"
  • branches/contrib/config/config.mk

    r491 r500  
    2222
    2323all: config/mconf/mconf
    24 
    25 config/check: plugins/check
    2624
    2725config/mconf/mconf:
     
    5452          >$(TOPDIR)/config/archs.in
    5553
    56 config/clean: config/check
     54config/clean:
    5755        $(MAKE) -C $(MCONF_DIR) clean
    5856
     
    6462config defconfig oldconfig menuconfig: TARGET_ARCH=
    6563
    66 config: config/check config/mconf/conf FORCE
     64config: plugins/generate-config config/mconf/conf FORCE
    6765        $(CONF) Config.in
    6866        @echo "Type make help to get a list of available DebWrt make commands"
    6967
    70 defconfig: config/check config/mconf/conf FORCE
     68defconfig: plugins/generate-config config/mconf/conf FORCE
    7169        touch .config
    7270        $(CONF) -D .config Config.in
    7371        @echo "Type make help to get a list of available DebWrt make commands"
    7472
    75 oldconfig: config/check config/mconf/conf FORCE
     73oldconfig: plugins/generate-config config/mconf/conf FORCE
    7674        $(CONF) -o Config.in
    7775        @echo "Type make help to get a list of available DebWrt make commands"
    7876
    79 menuconfig: config/check config/mconf/mconf FORCE
     77menuconfig: plugins/generate-config config/mconf/mconf FORCE
    8078        $(MCONF) Config.in
    8179        @echo "Type make help to get a list of available DebWrt make commands"
    8280
    83 .PHONY: config/clean \
    84         config/check
     81.PHONY: config/clean
    8582
  • branches/contrib/config/plugin.in

    r482 r500  
    1 menu "Plugins"
    21
     2source "tmp/plugins-generated.in"
    33source "plugins/*/Config.in"
    44
    5 endmenu
     5
  • branches/contrib/plugins/example/Config.in

    r490 r500  
    3535        default "128A6A00-29FA-11E2-81C1-0800200C9A66"
    3636
    37 menu "Plugin Example"
     37if PLUGIN_EXAMPLE
     38
     39menu "Target Plugin Example Configuration"
    3840
    3941config PLUGIN_EXAMPLE_ENABLE
    40         bool "Example"
     42        bool
     43        default y if PLUGIN_EXAMPLE
    4144        deselect HAS_SUBTARGETS
    4245        deselect DO_CONF_TARGETS
     
    148151
    149152endmenu
     153
     154endif
  • branches/contrib/plugins/plugins.mk

    r492 r500  
    2626                                -name '.*' \
    2727                                -printf '%f\n')
     28PLUGIN_CHOICE_BEGIN = \
     29choice\n\
     30   prompt \"Target Plugin\"\n\
     31   default PLUGIN_NONE \n\
     32   help\n\
     33     Select a target plugin\n\
     34\nconfig PLUGIN_NONE\n\
     35  bool\n\
     36  prompt \"None\"\n\
     37
     38PLUGIN_CHOICE_END = \
     39endchoice\n
     40
     41PLUGIN_CONFIG_LINE = \
     42config PLUGIN_$${plugin_up}\n\
     43  bool\n\
     44  prompt \"$${plugin}\"\n\
     45  deselect HAS_SUBTARGETS\n\
     46  deselect DO_CONF_TARGETS\n\
     47
    2848
    2949# Register target
     
    112132endif
    113133
     134plugins/generate-config:
     135        @/bin/echo -e "$(PLUGIN_CHOICE_BEGIN)" >$(TOPDIR)/tmp/plugins-generated.in
     136        @for plugin in $(PLUGINS_AVAILABLE); \
     137        do \
     138          plugin_up=$$(echo $${plugin} | tr [a-z] [A-Z]); \
     139          echo "Generating config for plugin: $${plugin_up}"; \
     140          /bin/echo -e "$(PLUGIN_CONFIG_LINE)" >>$(TOPDIR)/tmp/plugins-generated.in; \
     141        done
     142        @/bin/echo -e "$(PLUGIN_CHOICE_END)" >>$(TOPDIR)/tmp/plugins-generated.in
     143        touch $@
     144
    114145plugins/list:
    115146        @for plugin in $(PLUGINS_AVAILABLE); \
Note: See TracChangeset for help on using the changeset viewer.