m4
´Â ÀÔ·ÂÀÇ ¾î¶² À§Ä¡¿¡¼µçÁö ÆÄÀÏÀÇ À̸§À» ÁöÁ¤ÇÏ¿© »ðÀÔÇÒ ¼ö ÀÖ´Ù.
m4
¿¡¼ ÆÄÀÏÀ» »ðÀÔÇÏ´Â ³»Àå ¸ÅÅ©·Î´Â 2°³°¡ ÀÖ´Ù.
include(filename) sinclude(filename)
µÑ ´Ù filenameÀ̶ó´Â À̸§ÀÇ ÆÄÀÏÀ» m4
·Î ÀоîµéÀδÙ. ÆÄÀÏÀÇ ³¡¿¡
´Ù´Ù¶ú´Ù¸é ÀÔ·ÂÀº ÀÌÀü¿¡ Àдø ÀÔ·ÂÆÄÀÏ·Î ´Ù½Ã °è¼ÓµÈ´Ù.
µû¶ó¼ include
¿Í sinclude
ÀÇ È®ÀåÀº filenameÀÇ ¼Ó
³»¿ëÀÌ µÈ´Ù.
include
µÇ´Â ÆÄÀÏÀÌ Á¸ÀçÇÏÁö ¾Ê´Â °ÍÀÌ¸é ¿¡·¯ÀÌ´Ù. Á¸ÀçÇÏÁö ¾Ê´Â ÆÄÀϵé
¶§¹®¿¡ ¿¡·¯ ¸Þ½ÃÁö°¡ »ý±â´Â °ÍÀ» ¿øÇÏÁö ¾Ê´Â´Ù¸é, sinclude
¸¦ »ç¿ëÇ϶ó.
¸¸ÀÏ Á¸ÀçÇÑ´Ù¸é È®ÀåµÇ°í ±×·¸Áö ¾ÊÀ¸¸é ¾Æ¹« °ÍÀ¸·Îµµ È®ÀåµÇÁö ¾Ê´Â´Ù.
include(`no-such-file') => error-->30.include:2: m4: Cannot open no-such-file: No such file or directory sinclude(`no-such-file') =>
`incl.m4' ÆÄÀÏÀÌ ´ÙÀ½°ú °°Àº ³»¿ëÀ» °¡Áö°í ÀÖ´Ù°í °¡Á¤ÇÏÀÚ.
Include file start foo Include file end
º¸ÅëÀÇ °æ¿ì, ÆÄÀÏÀ» »ðÀÔÇϱâ´Â ÆÄÀÏÀÇ ¼Ó ³»¿ëÀ» ÇöÀçÀÇ ÀÔ·Â ½ºÆ®¸²À¸·Î
»ðÀÔÇϱâ À§ÇØ ¾²ÀδÙ. ÆÄÀÏÀÇ ³»¿ëÀÌ mr
¿¡ ÀÇÇØ ÀÐÇôÁö°í ±× ÆÄÀÏÀÇ
³»¿ë¿¡ ÀÖ´Â ¸ÅÅ©·Î È£ÃâÀº È®ÀåµÉ °ÍÀÌ´Ù.
define(`foo', `FOO') => include(`incl.m4') =>Include file start =>FOO =>Include file end =>
include
¿Í sinclude
°¡ ÆÄÀÏÀÇ ³»¿ëÀ¸·Î È®ÀåµÈ´Ù´Â »ç½ÇÀº Àüü
ÆÄÀϵ鿡¼ ÀÛµ¿ÇÏ´Â ¸ÅÅ©·Î¸¦ Á¤ÀÇÇÏ´Â µ¥¿¡ ¾²ÀÏ ¼ö ÀÖ´Ù. ¿¹¸¦ µé¸é,
¿©±â¿¡¼ `bar'´Â `incl.m4'ÀÇ ³»¿ëÀ¸·Î È®ÀåÇϵµ·Ï Á¤ÀǵȴÙ.
define(`bar', include(`incl.m4')) => This is `bar': >>>bar<<< =>This is bar: >>>Include file start =>foo =>Include file end =><<<
ÀÌ·¯ÇÑ include
ÀÇ »ç¿ëÀº ÆÄÀÏÀÌ Àο빮ÀÚ, ½°Ç¥, °ýÈ£ µîÀ» Æ÷ÇÔÇÒ ¼ö
Àֱ⠶§¹®¿¡ ±×¸® »·ÇÑ °ÍÀÌ ¾Æ´Ï´Ù. ÀÌ·± °ÍµéÀÌ m4°¡ ±¸¹® ºÐ¼® ÀÛ¾÷À» ÇÏ´Â µ¥
³¢¾î µé ¼öµµ ÀÖ´Ù.
³»Àå ¸ÅÅ©·Î include
¿Í sinclude
´Â ÀÎÀÚ°¡ ÀÖÀ» ¶§¿¡¸¸ ÀνĵȴÙ.
GNU m4
¿¡¼´Â ÇöÀç ÀÛ¾÷ µð·ºÅ丮°¡ ¾Æ´Ñ ´Ù¸¥ µð·ºÅ丮¿¡¼ ÆÄÀÏÀ» ã¾Æ¼
»ðÀÔÇÏ´Â °ÍÀ» Çã¿ëÇÑ´Ù.
ÆÄÀÏ À̸§ÀÌ Àý´ë °æ·Î·Î ÁöÁ¤µÇ¾î ÀÖÁö ¾Ê°í, ÇöÀç ÀÛ¾÷ µð·ºÅ丮¿¡¼ º¸ÀÌÁö ¾Ê´Â´Ù¸é, ÁöÁ¤µÈ °Ë»ö °æ·Î ¼Ó¿¡¼ ÆÄÀÏÀ» ã¾Æ º»´Ù. ¸ÕÀú, ¸í·ÉÇà¿¡¼ `-I' ¿É¼ÇÀ¸·Î ÁöÁ¤ÇÑ °÷À» °Å±â¿¡ ÁöÁ¤µÈ ¼ø¼´ë·Î µÚÁø´Ù. µÎ ¹ø°·Î, `M4PATH' ȯ°æº¯¼ö°¡ ¼³Á¤µÇ¾î ÀÖ´Ù¸é, ±×°ÍÀº ÄÝ·ÐÀ¸·Î ºÐ¸®µÈ µð·ºÅ丮ÀÇ ¸ñ·ÏÀ̾î¾ß Çϴµ¥, °Å±â¿¡ ÀÖ´Â ¼ø¼´ë·Î °Ë»öÇÒ °ÍÀÌ´Ù.
ÆÄÀÏ »ðÀԽà ÀÚµ¿ °Ë»ö¿¡¼ ¹®Á¦Á¡ÀÌ ¹ß»ýÇÑ´Ù¸é, `p' µð¹ö±ë Ç÷¡±×°¡ ÀÌ·¯ÇÑ ¹®Á¦Á¡À» µû·Î ¶¼¾î ³»´Â µ¥¿¡ µµ¿òÀÌ µÈ´Ù. (see section µð¹ö±ë Ãâ·ÂÀ» Á¦¾îÇϱâ).
Go to the first, previous, next, last section, table of contents.