GNU Make 第3ç Robert Mecklenburg èãç¢å¹ éé ç£è¨³ãèæ± å½° 訳 2005å¹´12æ çºè¡ 304ãã¼ã¸ ISBN4-87311-269-9 ãã©ã¼ããã Print åæ¸: Managing Projects with GNU Make, Third Edition
Go ã使ã£ã¦ãããã¯ããä½ãæãMakefile ã使ã£ã¦ãã«ããæå®ãããã¨ãå¤ãã§ãã çç±ã¨ãã¦ã¯ã ãã¼ã¸ã§ã³æ å ±ãªã©ãåãè¾¼ãã®ã«é½åããã è¤æ°ã®ãã¤ããªãåãåºãæã«é½åããã Go ã®ãã«ããªãã·ã§ã³ãæå®ããã®ã«ãããããã£ã¦æ´çãã¦ãããã äºåã«ã³ã¼ãã¸ã§ãã¬ã¼ã¿ã§æ¸ãåºãé¨åãããããããèãã㨠Makefile ãªã©ã§æ´çããã ãªã©ãªã©ã§ãããªã®ã§ä»åã¯ããã¸ã§ã¯ãã大ãããªã£ã¦ããä¸ã§ã©ããã Makefile ã®æ¸ãæ¹ããã¦ããããã¨ããã®ããç´¹ä»ãããã¨æãã¾ãã ãµã³ãã«ã¨ãã¦ãä»åã®ããã¸ã§ã¯ãã§ã¯ gRPC ã使ã£ããã£ãããµã¼ãã¹ã®ãµã¼ãã¼ã¨ã¯ã©ã¤ã¢ã³ããä½ããã¨ã«ãã¾ãããªãã¸ããªã¯ https://github.com/rosylilly/gochat ã«ç½®ãã¦ããã¾ããã Step 1. ãã¼ã¸ã§ã³æ å ±ãåãã ä»åã¯ãµã¼ãã¼ã¨ã¯ã©ã¤ã¢ã³
Advent Calendarã£ã¦ä½ï¼ 12æ1æ¥ããã¯ãªã¹ãã¹ã¾ã§ã®éãæ¥ãããã«ã¬ã³ãã¼ã®ããã«ããããããªããéããããã«ãæ¯æ¥äº¤ä»£ã§æè¡ã¨ã³ããªãæ¸ãã¦ããä¼ç»ã§ãï¼ ã©ããªå 容ãæ¸ãã°ããã®ï¼ CMake ã«é¢é£ããå 容ãªããªãã§ããã¾ãã¾ããï¼ CMake ã¯ãã使ããã¦ããå²ã«æ å ±ãå°ãªãã®ã§ã©ãã©ãæ¸ãã¦ããã¾ãããï¼ ã©ãã«æ¸ãã°ããã®ï¼ Qiitaã«è¨äºãä½æãã¦ãããã§ãããgistãèªåã®ããã°ãªã©ã©ãã§ãåé¡ããã¾ããã
2002 | 10 | 11 | 12 2003 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 2004 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 2005 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 2006 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 2007 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 2008 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 2009 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 1
CãC++ã§æ¸ãããããã°ã©ã ãMakeã使ã£ã¦ãã«ããããã¨ããã®ã¯Unix/Linuxã§ã¯ããè¡ããã¦ãããã¨ã ããã¡ããã¨ããMakefileãæ¸ãã®ã¯æå¤ã¨é£ããã ä¾ãã°ä»¥ä¸ã®3ã¤ã®ãã¡ã¤ã«ãããªãããã°ã©ã ãèããã foo.h: é¢æ°fooã®å®£è¨ãããã foo.c: é¢æ°fooã®å®è£ ãããã main.c: é¢æ°fooãå¼ã³åºãã /* foo.h */ void foo(int a); /* foo.c */ #include "foo.h" #include <stdio.h> void foo(int a){ printf("%d\n", a); } /* main.c */ #include "foo.h" int main(int argc, char **argv){ foo(10); return 0; } Makefileã¯ä¾ãã°ä»¥ä¸ã®ããã«æ¸ããã PRO
https://github.com/google/kati kati ã«ã¤ãã¦ãããã¥ã¡ã³ãæ¸ããâ¦ã¨æã£ã¦ããã®ã§ãããªããªãé²ã¾ãªãã®ã§ãã¨ããããæ¥æ¬èªã§æ¸ãã¦ã¿ããã¨ã«ãã¾ãããä½æ¸ããããã¾ãæ確ãããªããã¼ããªã®ã§ãä½æ¸ããèããã®ã¨è±èªèããã®ã両æ¹åæã«ããã®ãå°ã大å¤ã§ã åæ© kati 㯠GNU make ã®ã¯ãã¼ã³ã§ãããããå®å ¨ãªã³ã³ããã«ãªãã¨å¬ããã§ããããªããªãé£ããã ããã¨å人çã«ã¯è«¦ãã¦ãã¾ããç¨éã«å¯¾ãã¦å®ç¨çãªãã°è¯ãããªã¨ã åæ©ã¨ãã¦ã¯ã Android platform ã®ãã«ãã·ã¹ãã ãããªããªãã·ã¥ã¼ã«ãª GNU make é»éè¡ã§æ§æããã¦ãã¦ã make ãå®éã«ãªãããã¯ãããã¾ã§ãé ãã£ãã®ã§ããããé«éåãããã¨ãããã®ã§ããã ãã«ãã·ã¹ãã ãé ãã¨ããæãã¾ãã ããããã«ãã«ãã¨ãã«ãã«ãã®2ç¹ãèãã¾ãããã«ãã«ãã¦ã®ã¯ç
ãªã¼ãã¼ãã¼ããããé¢æ°ã®å¼ã³åºã(解決æ¡) @pepshisoãããããã£ã¨çãã¦ãã ãã£ã. #include <stdio.h> void f(int) { puts("f:int"); } void f(double) { puts("f:double"); } template <class P> struct call_ { explicit call_(P p) : p(p) {} void operator()(void (*func)(P)) const { func(p); } P p; }; template <class P> call_<P> call(P p) { return call_<P>(p); } int main() { call(5)(f); call(5.3)(f); } ãªãã»ã©, å¼æ°ã¨é¢æ°ãåæã«æ±ºãããã¨ããã¨é¢æ°ããã£ã¹ãããªãã¨ããã¾
_ scons http://blog.64p.org/entry/2012/07/11/224008 via https://plus.google.com/102550604876259086885/posts/AnEoGQexUcG scons ãªãã¦å§ã¾ã£ã¦ããããã! ã£ã¦ã®ãåã®æè¦ã ãªãããããã¦ãããªããã©ãå¿ è¦ãããªãæ©è½ã°ã£ãå å®ãã¦ããã¨ãã mukai ããã®ã¤ã¡ã¼ã¸ã«è³æããæãã scons ã«é¢ãã¦ãã¤ãè¨ã£ã¦ãæªå£ã«ããã¡ã¤ã«ãæ¬å½ã«å¤æ´ãããæã«ã ãä¾åé¢ä¿ããã«ãããªããã¦ãããã¨ãã便å©ãªæ©è½ãããã ããã¯ã©ããããã¨ãã¨ããã¨ã hello.c ãã hello.o 㨠hello ãä½ã£ããã¨ã hello.c ã touch ãã¦ããã«ãããªããã¦ãããªãã¨ã stdio.h ã¨ãæ¸ããããæã¨ããããããç¹æ®ãªãã¨ãã¦ããããããã touc
åºæ¬ã¡ãã¥ã¼ ããã ããããã° ãã©ã°ã¤ã³ããã¥ã¢ã« NintendoDS Homebrew æ²ç¤ºæ¿ GBA/NDS Link NDS/GBA æè¡æ å ± ã»GBATek æ¥æ¬èªè¨³ âGBA Ref.(å®) âNDS Ref.(翻訳ä¸) âCPU Ref.(æªæ´å) ã»DSTek æ¥æ¬èªè¨³(å®) ã»NDSLIB æ¥æ¬èªè¨³(å®) NDS å ¬éçã½ãã ã»BAKUDAN ã»é¡é³ãªã³ã»ã¬ã³ ã»NDS_TGM ã»NDS_åå·ç ã»NDS_è±æãããã ã»BGMãã¡ã¤ã©ã¼ âBGM ãã©ã¤ã(JP) âBGM Driver(EN) âMID ãã©ã¤ã(JP) ââMIDDRV éçº â------ âNDS ãµã¦ã³ãè¬åº§ âSMF2MML NDS ã½ããé¨å ã»thfifo æ¥æ¬èªè¨³ ã»é»åå¶å¾¡ âPowerControl ã»uITRON4
Chromium Notes: Ninja, a new build system ChromeãWindowsãã移æ¤ãå§ããã¨ããæã ã¯Sconsã使ã£ã¦Chromeããã«ããããã¨ãããSconsã¯ãæ£ããåä½ãã¦ã使ãæ¹ãç°¡åã§ãã£ããããããéçºãå§ãã¦ããã«ãSconsã¯ã¨ã¦ãé ãã¨ãããã¨ã«æ°ãã¤ãããã½ã¼ã¹ãå®éã«ãã«ããå§ããã¾ã§ã«ã40ç§ããããã®ã ãSconsãå ¨é¢çã«æªãã¨ããããã§ããªããChromeã®ãã«ãã¯ããã£ãã²ã¨ã¤ã®å®è¡ãã¡ã¤ã«ã®ããã«ãWebKitãå«ãã¦ã30000ãã®ãã¡ã¤ã«ãããã®ã ã çµå±ãç§ã¯Linuxãã«ãã®ããã«ãåã«Makefileã使ããã¨ã«ãããããã¯ãæã ã®ãã«ãã·ã¹ãã ããã¡ã¿ãã«ãã·ã¹ãã ãããªãã¡ãWindowsãMacç¨ã®ãã«ããã¡ã¤ã«ãçæãããã«ãã·ã¹ãã ã ã£ãããå¯è½ã ã£ãã®ã ãéçºãé²ããã»ã©ã«ãç§ã¯ã©ãã©ããã«ã
â [Ruby] makeã®ã³ãã³ãã©ã¤ã³è¡¨ç¤ºãé ã ãªã¤ããã ã¢ã¤ãã¢ãæ¡ç¨ãããã % make miniruby compiling ../ruby/trunk/main.c compiling ../ruby/trunk/dmydln.c compiling ../ruby/trunk/dmyencoding.c compiling ../ruby/trunk/version.c compiling ../ruby/trunk/dmyversion.c compiling miniprelude.c compiling ../ruby/trunk/array.c compiling ../ruby/trunk/bignum.c compiling ../ruby/trunk/class.c compiling ../ruby/trunk/compar.c compiling ..
ä»çµã¿ãå¤ã£ã¦ãã¾ãã° Makefile ã¯ç°¡æ½ã«æ¸ãã¾ãï¼$(CC) ã¨ã $@ ã¨ã $< ãªãã¦å¤æ°ã¯ä½¿ã£ããè² ãã§ãï¼ åºæ¬(ãã®1) ã½ã¼ã¹ã³ã¼ã hoge.c ãã å®è¡å½¢å¼ã®ãã¤ã㪠hoge ãçæããMakefileã¯ï¼ä»¥ä¸ã®ããã«æ¸ãã¾ããã all: hogeããã ãã§ãï¼ãã㧠$ make all ã¨ãã㨠hoge ãçæããã¾ã éè¦ãªç¹ã¯ï¼ééã£ã¦ã all: hoge hoge: hoge.c $(CC) hoge.c -o hogeã®ãããªMakefileãæ¸ããªããã¨ã§ãï¼ãã®ãããªMakefileã§ã¯ #!/bin/sh CC=gcc $CC hoge.c -o hoge ã¨ãããããªã·ã§ã«ã¹ã¯ãªããã¨åç¨åº¦ã®ä½¿ãåæããããã¾ããï¼ åºæ¬(ãã®2) ããã§ä¾ãã°-O3 ãä»ãã¦ã³ã³ãã¤ã«ãããå ´åãï¼-lm ãä»ãã¦ãªã³ã¯ãããå ´åã¯ä»¥ä¸ã®ããã«ã
ä¸æMakefileã«åã£ã¦ãã¾ãããMakefileã®è¨è¿°æ§æã®ãªãã«ããLispã«ä¼¼ãå°ããªé¢æ°åè¨èªãåãè¾¼ã¾ãã¦ãããã ãã¨ãè¨ã£ã¦ã¾ãããããããã¯ã¾ã¼ãéã³ååãªãã ãã©ããã®ãã®ç¥èã¯ãå®éã«Makefileãèªã¿æ¸ãããã¨ãã«ãå½¹ã«ãã¡ã¾ãã éå»ã®Makefileé¢ä¿ã¨ã³ããªã¼ãèªã¿è¿ããã¨æã£ããããã£ããéãããããç´ä½æ²æããããã§ãããã«æ´çãã¦ã¾ã¨ãã¦ãããã¨æãã¾ãã å å®¹ï¼ åèè³æ æ¦å¿µã¨ç¨èª ãã¼ã¿å å¤æ° é¢æ° å¶å¾¡æ§é ç»é¢åºåã¨å¼·å¶çµäº âåèè³æ Makefileã«é¢ãã¦ã¯ã次ã®ã¨ã³ããªã¼ç¾¤ã§ã´ã¿ã´ã¿ã¨èª¬æãã¦ãã¾ãã Makefileã®æ¸ãæ¹ããã®åã©ãã Makefileã®æ¸ãæ¹ï¼ããã°ã©ãã³ã°è¨èªMake ããã°ã©ãã³ã°è¨èªMake è£éºï¼å¼æ°ä»ãã®é¢æ° Make è£éºã®è£éºï¼éãã§ããã ã Makeè¨èªã§ç®è¡æ¼ç® <-- ãã«ï¼ ãã£ã¨ã
GNU Make 第3çã§ã¯ã大ããªããã¸ã§ã¯ãã§è¯ããããè¤æ°ãã£ã¬ã¯ããªã«ã¾ããã£ãããã¸ã§ã¯ãã管çããå ´åã«ããã£ã¬ã¯ããªæ¯ã®Makeãå帰çã«å¼åºãæ¹æ³ã¯æ¨å¥¨ãã¦ã¾ãããã¾ãã.ccãã¡ã¤ã«ã®#include ä¾åé¢ä¿ãã¾ãã¹ã¯ãªããã§èª¿æ»ãã¦Makefileãçæããæ¹æ³ããããªãã¹ãã¼ãã§ãªãã¨ãããã¨ãç¥ãã¾ãããã»ãã¨ããããã£ã¦ã°ç©ããããªãã ãã®ç¡ç¥ããããã¯ãMakefileã人ã®èªãã¢ãã ã¨æã£ã¦ããªãã£ãã®ãåå ã§ããèªã¾ãªãã§ãèªåã§ãã¼ã«ã«ä½ããããããã¨ããããåãã°OKãã¨ã¬ã¬ã³ã㪠makefileãä½ããã¨å ¨ç¶åªåãã¦ãªãã®ã ãããç¡ç¥ãªã®ã¯å½ããåããã ãã¦ã以ä¸ã¯æ¬æ¥ã®ä½æ¥ã¡ã¢ãåå¼·ã®ããã®æ¨¡æ¬ããã¸ã§ã¯ããä½ã£ã¦ GNU Make 第3ç ãè¦ãªãããããããã£ã¦ã¿ã¾ããããããªãã£ã¬ã¯ããªæ§æã§ãã«ããè¡ãmakefileã§ãã proj
GNU bashã«ããããããªãã¼ã¸ã§ã³ãããã¾ããææ°ã¯ 3.2.* ãããã§ãã1.14.* ãªãã¦å¤ãã®ãã¾ã 使ãã¾ãããã¦ã次ã®foræã¯ã·ã§ã«ã®ãã¼ã¸ã§ã³ã«ããæåãéãã¾ãã $ for x in ; do echo $x; done GNU bash, version 3.00.15(1)-release (i686-redhat-linux-gnu) ã ã¨ä½ãå®è¡ããã¾ããããã¨ã©ã¼ã§ãããã¾ãããGNU bash, version 2.04.0(1)-release (i686-pc-msys) ã ã¨ã次ã®ã¨ã©ã¼ã«ãªãã¾ãã sh: syntax error near unexpected token `;' ãã®éãã¯Makefileãæ¸ãã¨ããåé¡ã«ãªãã¾ãã dothis: for x in $(LIST); do\ echo "$$x";\ done ã®ããã«æ¸ã
ã«ã¬ã³ããã£ã¬ã¯ããªã«è¤æ°ã®XMLãã¡ã¤ã«(*.xml)ãããã ãããHTMLã«å¤æãããã ãã®ã¨ãMakeã使ã£ã¦ãæ´æ°ããããã¡ã¤ã«ã ãå¤æããããã«ããããã©ãããã°ãããã åææ¡ä»¶ å¤æã³ãã³ã㯠/bin/toHtml ã¨ãã( æ¨æºå ¥åããXMLãå ¥ãã¦ãæ¨æºåºåã«HTMLãåºåããã ) xmlããhtmlã«å¤æããã¨ããã¡ã¤ã«åã¯æ¡å¼µå以å¤ã¯ä¸è´ããã foo.xml â foo.html XMLãã¡ã¤ã«ã¯ã©ãã©ãå¢ãã¦ãã çµè«ã ããç¥ãããæ¹ã¯ãããã¯ãªãã¯ã ããXMLãã¡ã¤ã«æ°ãå¤åããªããªãã°... ããXMLãã¡ã¤ã«æ°ãå¤åããªããªãã°ã Makefile ã«ä»¥ä¸ã®ããã«è¨è¿°ãã¦ããã°ããã (å¤æ対象ã¨ãªããã¡ã¤ã«ã¯ foo1.xml foo2.xml foo3.xml) .SUFFIXES: .SUFFIXES: .xml .html .xml.htm
OMakeããããOMakeã¯ãã¸ã§ãããã OMakeã¯GNU makeã®ä»£æ¿åã¿ãããªãã®ãªãã ãã©ãæ£ç´ãªã¨ãããã®ãã¼ã«ã®å¼·åãã¯GNU makeã¨æ¯ã¹ãã¨å¤±ç¤¼ãªãããããããããã®ãããã§ããã³ã¼ãä¿®æ£âãã«ãâãããã°âã³ã¼ãä¿®æ£âã»ã»ã»ãã®ã«ã¼ãã®ããã«ãã«ãããä½æ¥ãã»ã¼æ¶ãå»ã£ãã ãã¡ã¤ã«ã®ä¾åé¢ä¿ã®è§£æãã¨ã«ããããããããããã¦ã¼ã¹ã±ã¼ã¹ãªããã®å ´åãæå°éã®æéã§ã»ã¼å®ç§ã«ä¾åé¢ä¿ãç¶²ç¾ ãã¦ããããªã«ãã«ããã¦ãããã ã¨ãããããã¯ãã¿ããå®éã«ä½¿ã£ã¦ã¿ãã±ã¼ã¹ãä¾ã«ã¨ã£ã¦ãã®ãããã®ä¸ç«¯ãç´¹ä»ãããã¨æãã case study è«ãã証æ ã¨ãããã¨ã§ãèªåã OMake ã試ãã«ã¤ãã£ã¦ã¿ãã±ã¼ã¹ãç´¹ä»ãããCè¨èªã§ã¹ã¿ãã£ãã¯ã©ã¤ãã©ãªãä½ã£ã¦ãã¦ãããã«å ãã¦ç°¡åãªãã¹ãããã°ã©ã ãæ¸ãã¦ããã /include/ 以ä¸ã«ããããã¡ã¤ã«ãå ¨é¨ãã /sr
ãã®ç« ã§ã¯GNUããã°ã©ã ç¨ã«Makefileãè¨è¿°ããéã®æ £ç¿ã«ã¤ãã¦æ¸ãã¦ããã¾ãã Makefileã®ä¸è¬çãªæ £ç¿ Makefileã«ã¯æ¬¡ã®è¡ãæ¯åå«ããã¹ãã§ãã SHELL = /bin/sh â¦ã¨ããã®ã¯ãç°å¢ããSHELLå¤æ°ãåãç¶ãå¾ãã·ã¹ãã ä¸ã§ã®ãã©ãã«ãé¿ããããã§ãã(GNU makeã§ã¯ããã¯å ¨ãåé¡ã«ãªãã¾ããã) å¥ã®makeããã°ã©ã ã«ã¯éäºæã®ãµãã£ãã¯ã¹ãªã¹ããæé»ã«ã¼ã«ããããå ´åã«ãã£ã¦æ··ä¹±ããããããåä½ä¸è¯ãèµ·ããã¾ãããã®ãã次ã®ããã«ãåã ã®Makefileã§å¿ è¦ãªãµãã£ãã¯ã¹ã ããæ示çã«ãµãã£ãã¯ã¹ãªã¹ãã«ã»ããããã®ãè¯çã§ãã .SUFFIXES: .SUFFIXES: .c .o ã¯ããã®è¡ã§ãµãã£ãã¯ã¹ãªã¹ããããããã£ã±ãé¤å»ãã¦ã次ã®è¡ã§ãã®Makefileã§æé»ã«ã¼ã«ã«æ¸¡ããã¦ããããµãã£ãã¯ã¹ãå ¨é¨æ¸ãè¾¼ã¿ã¾ãã ã³ãã³
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}