<?xml?>

<gwbuild>

  <project name="aqhome" version="0.0.1" so_current="0" so_age="0" so_revision="0" write_config_h="TRUE">
    <setVar name="package">$(project_name)</setVar>
    <setVar name="version">
      $(project_vmajor).$(project_vminor).$(project_vpatchlevel)
    </setVar>
    <define name="PACKAGE" value="$(package)"  quoted="TRUE" />



    <!-- version -->
    <setVar name="AQHOME_VERSION_MAJOR">$(project_vmajor)</setVar>
    <setVar name="AQHOME_VERSION_MINOR">$(project_vminor)</setVar>
    <setVar name="AQHOME_VERSION_PATCHLEVEL">$(project_vpatchlevel)</setVar>
    <setVar name="AQHOME_VERSION_BUILD">$(project_vbuild)</setVar>
    <setVar name="AQHOME_VERSION_TAG">$(project_vtag)</setVar>
    <setVar name="AQHOME_SO_CURRENT">$(project_so_current)</setVar>
    <setVar name="AQHOME_SO_REVISION">$(project_so_revision)</setVar>
    <setVar name="AQHOME_SO_AGE">$(project_so_age)</setVar>
    <setVar name="AQHOME_SO_EFFECTIVE">$(project_so_effective)</setVar>
    <setVar name="AQHOME_VERSION_STRING">
      $(project_vmajor).$(project_vminor).$(project_vpatchlevel)
    </setVar>
    <setVar name="AQHOME_VERSION_FULL_STRING">
      $(project_vmajor).$(project_vminor).$(project_vpatchlevel).$(project_vbuild)$(project_vtag)
    </setVar>
    <define name="AQHOME_VERSION_STRING" value="$(AQHOME_VERSION_STRING)" quoted="TRUE" />



    <!-- prefix handling -->
    <option id="prefix" type="string">
      <default>/usr/local</default>
    </option>
    <setVar name="prefix">$(option_prefix)</setVar>
    <setVar name="exec_prefix">$(option_prefix)/bin</setVar>
    <setVar name="sysconfdir">$(option_prefix)/etc</setVar>
    <setVar name="bindir">$(option_prefix)/bin</setVar>
    <setVar name="sbindir">$(option_prefix)/sbin</setVar>
    <setVar name="libdir">$(option_prefix)/lib</setVar>
    <setVar name="includedir">$(option_prefix)/include</setVar>
    <setVar name="datarootdir">$(option_prefix)/share</setVar>
    <setVar name="datadir">$(option_prefix)/share</setVar>
    <setVar name="localedir">$(option_prefix)/share/locale</setVar>

    <setVar name="pkglibdir">$(libdir)/$(package)</setVar>
    <setVar name="pkgincludedir">$(includedir)/aqhome/$(package)</setVar>
    <setVar name="pkgdatadir">$(datadir)/$(package)</setVar>


    <option id="debug" type="string">
      <default>TRUE</default>
      <choices>TRUE FALSE</choices>
    </option>
    <ifVarMatches name="option_debug" value="TRUE" >
      <setVar name="CFLAGS">-ggdb -Wall -O0</setVar>
      <setVar name="CXXFLAGS">-ggdb -Wall -O0</setVar>
    </ifVarMatches>


    <!-- use "-Owith_avr=TRUE" or "FALSE" to enable or disable assembling AVR code -->
    <option id="with_avr" type="string">
      <default>TRUE</default>
      <choices>TRUE FALSE</choices>
    </option>


    <checkheaders>
      signal.h
      sys/stat.h
      sys/types.h
    </checkheaders>


    <checkfunctions type="c" >
      getpid
    </checkfunctions>



    <checkProgs>
      <prog cmd="avrdude" id="avrdude" />
    </checkProgs>



    <dependencies>
      <dep id="gwenhywfar" name="gwenhywfar" minversion="5.8.2.1" required="TRUE" >
        <variables>plugindir gwengui-fox16</variables>
      </dep>
      <dep id="aqdatabase" name="aqdatabase" minversion="1.99.1.0" required="TRUE" >
        <variables>aqdatabase_typemakerdir</variables>
      </dep>
    </dependencies>



    <!-- symbol visibility -->
    <checkCompiler>
      <arg name="has_symbol_visibility">-fvisibility=hidden</arg>
    </checkCompiler>
    
    <ifVarMatches name="has_symbol_visibility" value="TRUE" >
      <setVar name="visibility_cflags">-fvisibility=hidden</setVar>
      <define name="GCC_WITH_VISIBILITY_ATTRIBUTE" />
    </ifVarMatches>



    <subdirs>
      aqhome
      apps
    </subdirs>

    <ifVarMatches name="option_with_avr" value="TRUE" >
      <subdirs>
        avr
      </subdirs>
    </ifVarMatches>




    <!-- build with "gwbuild -B flash" -->
    <ifVarMatches name="avrdude_EXISTS" value="TRUE" >
      <buildFiles name="flash" auto="FALSE" >
        <!-- TODO: input does not see built files! -->
        <input>
          <files match="*.hex" />
        </input>
        
        <output>
        </output>

        <cmd tool="$(avrdude)" checkDates="FALSE"  >
          -p t84 -c stk500 -P /dev/ttyACM0 -B16 -U hfuse:w:0xD7:m -U efuse:w:0xFE:m  -U flash:w:avr/att84_temp1.hex
        </cmd>

        <buildMessage>
          Flashing hex file to AVR.
        </buildMessage>
      </buildFiles>

      <buildFiles name="flash2" auto="FALSE" >
        <!-- TODO: input does not see built files! -->
        <input>
          <files match="*.hex" />
        </input>
        
        <output>
        </output>

        <cmd tool="$(avrdude)" checkDates="FALSE"  >
          -p t84 -c stk500 -P /dev/ttyACM0 -B16 -U hfuse:w:0xD7:m -U efuse:w:0xFE:m  -U flash:w:avr/att84_bootloader.hex
        </cmd>

        <buildMessage>
          Flashing BASE hex file to AVR.
        </buildMessage>
      </buildFiles>

      <buildFiles name="flash3" auto="FALSE" >
        <!-- TODO: input does not see built files! -->
        <input>
          <files match="*.hex" />
        </input>
        
        <output>
        </output>

        <cmd tool="$(avrdude)" checkDates="FALSE"  >
          -p t84 -c stk500 -P /dev/ttyACM0 -B16 -U hfuse:w:0xD7:m -U efuse:w:0xFE:m  -U flash:w:avr/att84_testflashimg.hex
        </cmd>

        <buildMessage>
          Flashing test image hex file to AVR.
        </buildMessage>
      </buildFiles>

    </ifVarMatches>
        


  </project>

</gwbuild>
