Qt ÇÁ·Î±×·¡¹ÖÀ» À§ÇÑ tmake °­Á ÀúÀÚ : ³ë Á¤ ¹Î (Çѱ¹ Ç×°ø´ëÇб³ Åë½ÅÁ¤º¸°øÇаú ´ëÇпø ) http://esc.cl.hangkong.ac.kr/~hmask mailto://hmask@esc.cl.hangkong.ac.kr ³¯Â¥ : 2000³â 8¿ù 26ÀÏ ÀÌ ¹®¼­´Â ÀúÀÚÀÇ µ¿ÀǾøÀÌ ¹®¼­ÀÇ ³»¿ëÀ» ¹Ù²Ü ¼ö ¾ø½À´Ï´Ù. ÇÏÁö¸¸ ÀúÀÚÀÇ µ¿ÀǾøÀÌ ´Ù¸¥°÷¿¡ reposting ÇÒ ¼ö´Â ÀÖ½À´Ï´Ù. [1] tmake¶õ? ¼Ò½ºÆÄÀÏÀÌ ¿©·¯°³À϶§´Â MakefileÀ» ¸¸µé¾î¼­ ÄÄÆÄÀÏÇÏ°Ô µË´Ï´Ù. Qt ¶óÀ̺귯¸®¸¦ »ç¿ëÇؼ­ ÄÄÆÄÀÏ ÇÒ¶§´Â ½Ã±×³Î°ú ½½·ÔµîÀÌ Ã·°¡µÇ±â ¶§¹®¿¡ MakefileÀ» ¸¸µå´Â°ÍÀÌ ½±Áö ¾Ê½À´Ï´Ù. µû¶ó¼­ Qt¸¦ Á¦ÀÛÇÑ Troll-Tech¿¡¼­´Â MakefileÀ» ½±°Ô ¸¸µé¾î ÁÖ´Â tmake¸¦ °°ÀÌ Á¦°øÇÕ´Ï´Ù. tmake´Â Qt¶óÀ̺귯¸®¸¦ »ç¿ëÇÏ´Â ¼Ò½ºÀÇ MakefileÀ» ½±°Ô ÀÛ¼ºÇÒ ¼ö ÀÖ°Ô ÇØÁÖ´Â µµ±¸ ÀÔ´Ï´Ù. [2] tmake ±¸Çϱâ tmake´Â ´ÙÀ½ÀÇ ½ÎÀÌÆ®¿¡¼­ ±¸ÇÒ ¼ö ÀÖ½À´Ï´Ù. http://www.troll.no/freebies/tmake.html ftp://ftp.troll.no/freebies/tmake [3] tmake ¼³Ä¡ ÇöÀç tmakeÀÇ ÃֽŠ¹öÀüÀº 1.3ÀÔ´Ï´Ù. ´ÙÀ½°ú °°ÀÌ /usr/local µð·ºÅ丮¿¡ tmake¸¦ ¼³Ä¡ÇÕ´Ï´Ù. # cd /usr/local # tar -xvzf tmake-1.3_tar.gz ÇÁ·Î±×·¥À» ¼³Ä¡ÇÑ ´ÙÀ½¿¡´Â ¼³¸í¼­¿¡ ÀÖ´Â ´ë·Î °æ·Î¸¦ ¼³Á¤ÇØ ÁÝ´Ï´Ù.. [Unix Bourne shell:] TMAKEPATH=/usr/local/tmake/lib/linux-g++ PATH=$PATH:/usr/local/tmake/bin export TMAKEPATH PATH [Unix C shell:] setenv TMAKEPATH /usr/local/tmake/lib/linux-g++ setenv PATH $PATH:/usr/local/tmake/bin [4] tmake ¼³Á¤ÆÄÀÏ ÆíÁý /usr/local/tmake/lib/linux-g++ µð·ºÅ丮¸¦ »ìÆ캸¸é tmakeÀÇ È¯°æ¼³Á¤ ÆÄÀÏÀÎ tmake.conf ÆÄÀÏÀÌ ÀÖ´Ù. ¿©±â¼­´Â »ç¿ëÇÏ´Â C ÄÄÆÄÀÏ·¯¿Í ÅÛÇø´, ¶óÀ̺귯¸® °æ·Î¸¦ ¼³Á¤ÇÕ´Ï´Ù. ±âº»ÀûÀÎ ¼³Á¤Àº µÇ¾îÀÖÁö¸¸ ¸®´ª½º ¹èÆ÷º»À̳ª, »ç¿ëȯ°æ¿¡ µû¶ó¼­ Qt °æ·Î°¡ ÆíÁý ÆÄÀÏ°ú ´Ù¸¦ ¼öµµ ÀÖ½À´Ï´Ù. µû¶ó¼­ »ç¿ëÇÏ´Â C ÄÄÆÄÀÏ·¯¿Í, Qt ¶óÀ̺귯¸® °æ·Î µîÀ» ÀÚ½ÅÀÇ ½Ã½ºÅÛ¿¡ ¸Â°Ô ÆíÁýÇÕ´Ï´Ù. ¼³Á¤ ÆÄÀÏÀÇ ÀϺδ ´ÙÀ½°ú °°½À´Ï´Ù. # $Id: tmake.conf,v 1.15 1999/07/28 15:21:49 hanord Exp $ # tmake configuration for linux-g++ TEMPLATE = app CONFIG = qt warn_on release TMAKE_CC = gcc TMAKE_CFLAGS = -pipe TMAKE_INCDIR_X11 = /usr/X11R6/include TMAKE_LIBDIR_X11 = /usr/X11R6/lib TMAKE_INCDIR_QT = /usr/include/qt #Qt Çì´õÆÄÀÏ °æ·Î TMAKE_LIBDIR_QT = /usr/lib #Qt ¶óÀ̺귯¸® °æ·Î [5] tmake ÇÁ·ÎÁ§Æ®ÆÄÀÏ ¸¸µé±â ¼³Á¤À» ¸¶ÃÆÀ¸¸é ½ÇÁ¦ ¼Ò½º¸¦ °¡Áö°í ÇÁ·ÎÁ§Æ® ÆÄÀÏÀ» ¸¸µé¾î º¾½Ã´Ù. ¿¹Á¦ÀÇ ³»¿ëÀº ´ÙÀ½°ú °°½À´Ï´Ù. -------- main.cpp ------------------------------------------------------------ #include "QtEx2.h" #include "qapplication.h" int main( int argc, char **argv) { QApplication a( argc, argv); QtExample2 QtEx2; QObject::connect( &QtEx2, SIGNAL(quitMessage()), &a, SLOT(quit()) ); a.setMainWidget(&QtEx2); QtEx2.show(); return a.exec(); } ------------------------------------------------------------------------------ ------- QtEx2.h -------------------------------------------------------------- #include "qwidget.h" #include "qpushbutton.h" #include "qlineedit.h" class QtExample2 : public QWidget { Q_OBJECT public: QtExample2( QWidget *parent = 0, const char *name = 0 ); public: QPushButton *p_Button; QLineEdit *p_Edit; signals: void quitMessage(); private slots: void printMessage(); }; ------------------------------------------------------------------------------ ------- QtEx2.cpp ------------------------------------------------------------ #include "QtEx2.h" #include "qmessagebox.h" QtExample2::QtExample2( QWidget *parent, const char *name) : QWidget( parent, name) { resize( 400, 300); p_Button = new QPushButton( this, "Button"); p_Button->setGeometry( 20,50,100,40); p_Button->setText("Button"); connect( p_Button, SIGNAL(clicked()), SLOT(printMessage()) ); p_Edit = new QLineEdit( this, "Edit"); p_Edit->setGeometry( 130,50,200,40); } void QtExample2::printMessage() { QMessageBox::information(this,"Information",p_Edit->text()); if( strcmp("quit",p_Edit->text()) == 0 ) emit quitMessage(); } ------------------------------------------------------------------------------ ÀÌÁ¦ ÀÌ°ÍÀ» »ç¿ëÇÑ QtEx2.pro ÇÁ·ÎÁ§Æ® ÆÄÀÏÀÇ ³»¿ëÀº ´ÙÀ½°ú °°½À´Ï´Ù. TEMPLATE = app CONFIG = qt warn_on release HEADERS = QtEx2.h SOURCES = QtEx2.cpp \ main.cpp TARGET = QtEx2 /* ÆĶó¹ÌÅÍÀÇ ³»¿ë TEMPLATE : ÀÀ¿ëÇÁ·Î±×·¥(app), ¶óÀ̺귯¸®(lib), ¼­ºêµð·ºÅ丮(subdirs)µîÀÇ Å¸ÄÏÀ» ÁöÁ¤ÇÑ´Ù. CONFIG : ÇÊ¿ä·Î ÇÏ´Â ¶óÀ̺귯¸®¿Í ÄÄÆÄÀÏ ¿É¼ÇÀ» ÁöÁ¤ÇÑ´Ù. qt : Qt¸¦ ÀÌ¿ëÇÑ ¶óÀ̺귯¸® x11 : X-À©µµ¿ì¿ë ¶óÀ̺귯¸® warn_on : ÄÄÆÄÀÏ °úÁ¤¿¡¼­ °¡´ÉÇÑ ¸¹Àº °æ°í¸¦ Ç¥½ÃÇÑ´Ù. release : ÃÖÀûÈ­¸¦ ¼öÇàÇÑ´Ù. debug : µð¹ö±ë Á¤º¸¸¦ Æ÷ÇÔÇÑ´Ù. HEADERS : ÇÊ¿äÇÑ Çì´õÆÄÀÏÀ» Àû´Â´Ù. SOURCES : ÇÊ¿äÇÑ ¼Ò½ºÆÄÀÏÀ» Àû´Â´Ù. TARGET : ¸ñÀû ÇÁ·Î±×·¥ÀÇ À̸§ */ [6] tmakeÀÇ ½ÇÇà ÀÌÁ¦ ´ÙÀ½°ú °°ÀÌ tmake¿¡ -o ¿É¼ÇÀ» »ç¿ëÇϸé MakefileÀ» ¸¸µé ¼ö ÀÖ½À´Ï´Ù. tmake QtExample2.pro -o Makefile ¸¶Áö¸·À¸·Î make¸¦ ¼öÇàÇϸé(¼Ò½º¿¡ ¹®Á¦°¡ ¾ø´Â °æ¿ì) ÄÄÆÄÀÏ ÈÄ¿¡ ½ÇÇà ÇÁ·Î±×·¥ÀÌ ¿Ï¼ºµË´Ï´Ù.