jakarta 프로젝트의 ant를 gcc에서 사용할 수 있나요?

nohmad의 이미지

ant가 make를 대체할 수 있는 빌드툴인 것으로 알고 있는데,
아직 자바 프로그래머들 외엔 널리 사용되고 있지 않는 것 같습니다.
make 툴 사용방법을 배우자니 좀 부담스럽고,
자바에서 편리하게 사용하던 ant를 C 개발환경에서도 사용해보고 싶은데,
구글 선생님에게 물어봐도 시원스런 대답을 안 주시네요. :?
혹시 gcc에서 ant로 빌드하시는 분 계시면 참조할 곳을 알려주시기 바랍니다.

leanblue의 이미지

LeanBlue in CyberWorld!!!

mykldp의 이미지

ant-contrib 에서 제공하는 cpptask는 아직 개발 버젼입니다... 하지만 쓸만합니다^^

sourceforge의 다운로드 링크에 있는 걸 사용하시는 것보다는 CVS 에서 최신 소스를 직접 받아다 사용하시는 게 낫습니다.

ant-contrib의 개발자가 그렇게 하는걸 추천하더군요.

사용법은 CVS에 간단한 문서가 들어있으니 그걸 참조하시면 될겁니다.

저도 make 사용이 귀찮아서 make대용으로 사용할 빌드 툴을 찾다가 ant-contrib 의 cpptask를 사용하게 ㅤㄷㅚㅆ습니다.

한동안 SCons도 사용했었는데 제가 느끼기에는 상당히 불편했습니다.

하지만 사용하는 사람들이 제법 있는듯 하니 SCons를 한 번 고려해보시는 것도 괜찮을 것 같네요

www.scons.org 에서 필요한 정보들을 얻으실 수 있을 겁니다.

ant-contrib의 cpptask를 사용해서 c++프로젝트를 빌드한지 한 달 정도 되가는데 아직까지 이렇다할 에러나

문제점은 없었습니다. 하지만 ant-contrib의 개발자는 아직 베타 버젼에도 못 미친 것으로 생각하는 것 같더군요^^

아래는 제가 윈도에서 mingw 컴파일러와 wxWindows를 이용해 GUI를 만들때 사용하는 빌드 파일입니다. 참고가 됐으면 합니다.

<?xml version="1.0" encoding="UTF-16"?>
<project name="^^" default="build" basedir=".">

	<!-- settings for cpptasks (http://ant-contrib.sourceforge.net)-->
	<taskdef name="cc" classname="net.sf.antcontrib.cpptasks.CCTask"/>
	<typedef name="linker" classname="net.sf.antcontrib.cpptasks.LinkerDef"/>
	<typedef name="compiler" classname="net.sf.antcontrib.cpptasks.CompilerDef"/>

	<!-- project directory properties -->
	<property name="src.dir" value="src"/>
	<property name="lib.dir" value="lib"/>
	<property name="include.dir" value="include"/>
	<property name="build.dir" value="build"/>
	<property name="build.obj.dir" value="build/obj"/>
	
	<!-- project build properties -->
	<property name="debug" value="true"/>
	<property name="use-gcc" value="true"/>

	<!-- include path -->
	<path id="includepath">
		<dirset dir="${include.dir}">
			<include name="mswud"/>
			<include name="wx/msw/gnuwin32"/>
		</dirset>
		<pathelement path="${include.dir}"/>
	</path>
	
	<!-- compiler and linker definitions -->
	<compiler id="gcc" name="gcc" if="use-gcc">
		<compilerarg value="-Wall"/>
		<compilerarg value="-O"/>
		<compilerarg value="-fmessage-length=0"/>
	</compiler>
	<linker id="gcc-linker" name="gcc" if="use-gcc">
		<linkerarg value="-mwindows"/>
	</linker>
	
	<!--TODO: SET OPTIONS FOR MS-VISUAL C++
	<compiler id="msvc" name="msvc" if="use-msvc"/>
	<linker name="msvc" if="use-msvc"/>
	-->
	
	<!-- targets -->
	<target name="prepare">
		<mkdir dir="${build.dir}"/>
		<mkdir dir="${build.obj.dir}"/>
		<mkdir dir="${test.dir}"/>
	</target>
	
	<target name="build" depends="prepare">

		<cc debug="${debug}" link="executable" objdir="${build.obj.dir}" outfile="${build.dir}/test.exe"
		 multithreaded="true" exceptions="true"
		>
		
			<compiler refid="gcc" if="use-gcc"/>
			
			<linker refid="gcc-linker" if="use-gcc"/>
			
			<fileset dir="${src.dir}" includes="*.cpp"/>
			
			<includepath refid="includepath"/>
			
			<defineset>
				<define name="__WXMSW__"/>
				<define name="__WIN32__"/>
				<define name="__WINDOWS__"/>
				<define name="__GNUWIN32__"/>
				<define name="STRICT"/>
				<define name="WINVER=0x400"/>
				<define name="__WXDEBUG__" if="debug"/>
				<define name="NDEBUG" unless="debug"/>
			</defineset>
			
			<libset dir="${lib.dir}" libs="wxmswud, freetype" if="debug"/>
			<libset dir="${lib.dir}" libs="wxmswu, freetype"/>
			
			<syslibset libs="stdc++, gcc, odbc32, wsock32, winspool, winmm, shell32, 
			comctl32, ctl3d32, odbc32, advapi32, odbc32, wsock32, opengl32, glu32, 
			ole32, oleaut32, uuid"
			/>
		</cc>

	</target>
	
</project>

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.