{"id":64,"date":"2018-01-07T16:27:08","date_gmt":"2018-01-07T13:27:08","guid":{"rendered":"http:\/\/talhacelik.com.tr\/?p=64"},"modified":"2018-05-01T09:45:05","modified_gmt":"2018-05-01T06:45:05","slug":"makefile-nedir","status":"publish","type":"post","link":"https:\/\/talhacelik.com.tr\/index.php\/2018\/01\/07\/makefile-nedir\/","title":{"rendered":"Makefile Nedir ?"},"content":{"rendered":"<p style=\"text-align: left;\">C ve C++ dilleri ile u\u011fra\u015fanlar yada en az\u0131ndan C veya C++ ile yaz\u0131lm\u0131\u015f bir program\u0131n kaynak kodlar\u0131n\u0131 edinip derlemeye \u00e7al\u0131\u015fanlar makefile dosyas\u0131n\u0131 di\u011fer kaynak kodlar aras\u0131nda g\u00f6rm\u00fc\u015flerdir. Makefile haz\u0131rlanm\u0131\u015f olan program\u0131n k\u0131saca yeniden derlenmesine olanak sa\u011flayarak, de\u011fi\u015fiklikleri alg\u0131layarak bu farkl\u0131l\u0131klar\u0131 \u00fczerinde derleme i\u015flemini ger\u00e7ekle\u015ftiriyor. Bu sayede program\u0131n derleme a\u015famas\u0131 daha k\u0131sa s\u00fcrm\u00fc\u015f oluyor ki bizim i\u00e7in en \u00f6nemli \u015fey zaman \ud83d\ude42 .<\/p>\n<p>Makefile dosyas\u0131n\u0131 kullanabilmek i\u00e7in her linux da\u011f\u0131t\u0131m\u0131nda y\u00fckl\u00fc olarak gelen make arac\u0131n\u0131 kullanaca\u011f\u0131m.<\/p>\n<p>\u00d6ncelikle \u00f6rnek bir makefile dosyas\u0131 olu\u015ftural\u0131m ve i\u00e7erisine \u015funlar\u0131 yazal\u0131m ve hello.c ad\u0131na sahip kaynak kod dosyam\u0131z\u0131da olu\u015ftural\u0131m.<\/p>\n<p style=\"padding-left: 30px;\"><strong>output<\/strong>: hello.o<br \/>\ngcc hello.o -o programim<\/p>\n<p style=\"padding-left: 30px;\"><strong>hello.o<\/strong>: hello.c<br \/>\ngcc -c hello.c<\/p>\n<p style=\"padding-left: 30px;\"><strong>clean<\/strong>:<br \/>\nrm *.o<\/p>\n<p style=\"padding-left: 30px;\"><strong>install<\/strong>:<br \/>\ncp programim \/bin<\/p>\n<p>Makefile dosyam\u0131z\u0131n i\u00e7erisine yazd\u0131\u011f\u0131m\u0131z kodlar s\u0131ras\u0131yla :<\/p>\n<ul>\n<li>output : derlenecek kaynak kodumuzu ve nas\u0131l derlenece\u011fini referans g\u00f6steriyor<\/li>\n<li>clean\u00a0\u00a0 : derlemeden sonra olu\u015fan object dosyalar\u0131n\u0131 yok edecektir.<\/li>\n<li>install\u00a0 : son olarak programim ad\u0131ndaki \u00e7al\u0131\u015fmaya haz\u0131r program\u0131m\u0131z\u0131 \/bin dizininin i\u00e7ine atacakt\u0131r. Bu sayede her seferinde .\/ yazma zahtetinden de kurtumu\u015f oluyoruz.<\/li>\n<\/ul>\n<p>Son olarak makefile dosyam\u0131z\u0131 aktif etmek i\u00e7in terminal ekran\u0131na gidip <strong>make<\/strong> arac\u0131n\u0131 \u00e7al\u0131\u015ft\u0131ral\u0131m.<\/p>\n<p style=\"padding-left: 30px;\">gcc -c hello.c<br \/>\ngcc hello.o -o programim<\/p>\n<p>Bu \u00e7\u0131kt\u0131 bize program\u0131m\u0131z\u0131n ba\u015far\u0131l\u0131 bir \u015fekilde derlendi\u011fini bildirmektedir. \u0130\u015flemin ard\u0131ndan <strong>make clean<\/strong> diyerek .o uzant\u0131l\u0131 dosyalar\u0131m\u0131z\u0131 da yok ediyoruz.<\/p>\n<p style=\"padding-left: 30px;\">rm *.o<\/p>\n<p>Art\u0131k program\u0131m\u0131z ve proje dosyam\u0131z tertemiz. Y\u00fckleme i\u015flemini ba\u015flatmak i\u00e7inse<strong> make install <\/strong>diyelim.<\/p>\n<p style=\"padding-left: 30px;\">cp programim \/bin<\/p>\n<p>\u00c7al\u0131\u015fan kodu bize g\u00f6sterecektir.Makefile dosyas\u0131 ile olu\u015fturdu\u011fumuz program\u0131m\u0131z direkt olarak \u00e7a\u011f\u0131r\u0131larak \u00e7al\u0131\u015ft\u0131r\u0131labilir duruma gelmi\u015ftir.<\/p>\n<p style=\"padding-left: 120px;\">\n","protected":false},"excerpt":{"rendered":"<p>C ve C++ dilleri ile u\u011fra\u015fanlar yada en az\u0131ndan C veya C++ ile yaz\u0131lm\u0131\u015f bir program\u0131n kaynak kodlar\u0131n\u0131 edinip derlemeye \u00e7al\u0131\u015fanlar makefile dosyas\u0131n\u0131 di\u011fer kaynak kodlar aras\u0131nda g\u00f6rm\u00fc\u015flerdir. Makefile haz\u0131rlanm\u0131\u015f olan program\u0131n k\u0131saca yeniden derlenmesine olanak sa\u011flayarak, de\u011fi\u015fiklikleri alg\u0131layarak bu farkl\u0131l\u0131klar\u0131 \u00fczerinde derleme i\u015flemini ger\u00e7ekle\u015ftiriyor. Bu sayede program\u0131n derleme a\u015famas\u0131 daha k\u0131sa s\u00fcrm\u00fc\u015f oluyor ki &hellip;<\/p>\n","protected":false},"author":1,"featured_media":66,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,12],"tags":[14,15,3,13,4],"_links":{"self":[{"href":"https:\/\/talhacelik.com.tr\/index.php\/wp-json\/wp\/v2\/posts\/64"}],"collection":[{"href":"https:\/\/talhacelik.com.tr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/talhacelik.com.tr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/talhacelik.com.tr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/talhacelik.com.tr\/index.php\/wp-json\/wp\/v2\/comments?post=64"}],"version-history":[{"count":7,"href":"https:\/\/talhacelik.com.tr\/index.php\/wp-json\/wp\/v2\/posts\/64\/revisions"}],"predecessor-version":[{"id":73,"href":"https:\/\/talhacelik.com.tr\/index.php\/wp-json\/wp\/v2\/posts\/64\/revisions\/73"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/talhacelik.com.tr\/index.php\/wp-json\/wp\/v2\/media\/66"}],"wp:attachment":[{"href":"https:\/\/talhacelik.com.tr\/index.php\/wp-json\/wp\/v2\/media?parent=64"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/talhacelik.com.tr\/index.php\/wp-json\/wp\/v2\/categories?post=64"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/talhacelik.com.tr\/index.php\/wp-json\/wp\/v2\/tags?post=64"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}