Guest User

xmake

a guest
Sep 3rd, 2014
296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 2.41 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xmake>
  3.     <config>
  4.         <!-- Check for C compiler -->
  5.         <print text="Checking for C compiler..."/>
  6.         <test not="true" type="var" value="${C_COMPILER}">
  7.             <test type="exec" value="gcc">
  8.                 <var name="C_COMPILER" value="gcc"/>
  9.                 <var name="C_COMPILER_OPT_OUTFILE" value="-o "/>
  10.             </test>
  11.             <test not="true" type="var" value="${C_COMPILER}">
  12.                 <print text="not found\n"/>
  13.                 <error text="C compiler not found.\n"/>
  14.             </test>
  15.         </test>
  16.         <print text="${C_COMPILER}\n"/>
  17.  
  18.         <!-- Check for linker -->
  19.         <print text="Checking for linker..."/>
  20.         <test not="true" type="var" value="${LINKER}">
  21.             <test type="exec" value="ld">
  22.                 <var name="LINKER" value="ld"/>
  23.                 <var name="LINKER_OPT_OUTFILE" value="-o "/>
  24.             </test>
  25.             <test not="true" type="var" value="${LINKER}">
  26.                 <print text="not found\n"/>
  27.                 <error text="Linker not found.\n"/>
  28.             </test>
  29.         </test>
  30.         <print text="${LINKER}\n"/>
  31.  
  32.         <!-- Check for archiver -->
  33.         <print text="Checking for archiver..."/>
  34.         <test not="true" type="var" value="${ARCHIVER}">
  35.             <test type="exec" value="ar">
  36.                 <var name="ARCHIVER" value="ar"/>
  37.                 <var name="ARCHIVER_OPT_OUTFILE" value="-o "/>
  38.             </test>
  39.             <test not="true" type="var" value="${ARCHIVER}">
  40.                 <print text="not found\n"/>
  41.                 <error text="Archiver not found.\n"/>
  42.             </test>
  43.         </test>
  44.         <print text="${ARCHIVER}\n"/>
  45.     </config>
  46.  
  47.    
  48.     <target name="all">
  49.         <library name="MyLibrary">
  50.             <var name="${__LIBRARY_NAME__}_OBJS" value="main.o"/>
  51.  
  52.             <rule input="${${__LIBRARY_NAME__}_OBJS}" output="${__LIBRARY_NAME__}">
  53.                 <exec program="${ARCHIVER}">
  54.                     <arg value="${ARCHIVER_OPT_OUTFILE}${__RULE_OUTPUT__}"/>
  55.                     <arg value="${__RULE_INPUT__}"/>
  56.                 </exec>
  57.             </rule>
  58.         </library>
  59.  
  60.         <program name="MyProgram">
  61.             <var name="${__PROGRAM_NAME__}_OBJS" value="main.o"/>
  62.             <var name="${__PROGRAM_NAME__}_LIBS" value="-lMyLibrary"/>
  63.  
  64.             <rule input="${${__PROGRAM_NAME__}_OBJS}" output="${__PROGRAM_NAME__}">
  65.                 <exec program="${LINKER}">
  66.                     <arg value="${LINKER_OPT_OUTFILE}${__RULE_OUTPUT__}"/>
  67.                     <arg value="${__RULE_INPUT__}"/>
  68.                     <arg value="${${__PROGRAM_NAME__}_LIBS}"/>
  69.                 </exec>
  70.             </rule>
  71.         </program>
  72.  
  73.         <rule input="*.c" output="*.o"/>
  74.             <exec program="${C_COMPILER}">
  75.                 <arg value="${__RULE_INPUT__}"/>
  76.                 <arg value="${C_COMPILER_OPT_OUTFILE}${__RULE_OUTPUT__}"/>
  77.             </exec>
  78.         </rule>
  79.     </target>
  80. </xmake>
Advertisement
Add Comment
Please, Sign In to add comment