Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <xmake>
- <config>
- <!-- Check for C compiler -->
- <print text="Checking for C compiler..."/>
- <test not="true" type="var" value="${C_COMPILER}">
- <test type="exec" value="gcc">
- <var name="C_COMPILER" value="gcc"/>
- <var name="C_COMPILER_OPT_OUTFILE" value="-o "/>
- </test>
- <test not="true" type="var" value="${C_COMPILER}">
- <print text="not found\n"/>
- <error text="C compiler not found.\n"/>
- </test>
- </test>
- <print text="${C_COMPILER}\n"/>
- <!-- Check for linker -->
- <print text="Checking for linker..."/>
- <test not="true" type="var" value="${LINKER}">
- <test type="exec" value="ld">
- <var name="LINKER" value="ld"/>
- <var name="LINKER_OPT_OUTFILE" value="-o "/>
- </test>
- <test not="true" type="var" value="${LINKER}">
- <print text="not found\n"/>
- <error text="Linker not found.\n"/>
- </test>
- </test>
- <print text="${LINKER}\n"/>
- <!-- Check for archiver -->
- <print text="Checking for archiver..."/>
- <test not="true" type="var" value="${ARCHIVER}">
- <test type="exec" value="ar">
- <var name="ARCHIVER" value="ar"/>
- <var name="ARCHIVER_OPT_OUTFILE" value="-o "/>
- </test>
- <test not="true" type="var" value="${ARCHIVER}">
- <print text="not found\n"/>
- <error text="Archiver not found.\n"/>
- </test>
- </test>
- <print text="${ARCHIVER}\n"/>
- </config>
- <target name="all">
- <library name="MyLibrary">
- <var name="${__LIBRARY_NAME__}_OBJS" value="main.o"/>
- <rule input="${${__LIBRARY_NAME__}_OBJS}" output="${__LIBRARY_NAME__}">
- <exec program="${ARCHIVER}">
- <arg value="${ARCHIVER_OPT_OUTFILE}${__RULE_OUTPUT__}"/>
- <arg value="${__RULE_INPUT__}"/>
- </exec>
- </rule>
- </library>
- <program name="MyProgram">
- <var name="${__PROGRAM_NAME__}_OBJS" value="main.o"/>
- <var name="${__PROGRAM_NAME__}_LIBS" value="-lMyLibrary"/>
- <rule input="${${__PROGRAM_NAME__}_OBJS}" output="${__PROGRAM_NAME__}">
- <exec program="${LINKER}">
- <arg value="${LINKER_OPT_OUTFILE}${__RULE_OUTPUT__}"/>
- <arg value="${__RULE_INPUT__}"/>
- <arg value="${${__PROGRAM_NAME__}_LIBS}"/>
- </exec>
- </rule>
- </program>
- <rule input="*.c" output="*.o"/>
- <exec program="${C_COMPILER}">
- <arg value="${__RULE_INPUT__}"/>
- <arg value="${C_COMPILER_OPT_OUTFILE}${__RULE_OUTPUT__}"/>
- </exec>
- </rule>
- </target>
- </xmake>
Advertisement
Add Comment
Please, Sign In to add comment