Code Smart - Makefile (special release)

Y
Yu-Chuan PiStudent at Department of CSIE, NCKU, Taiwan
pe cial
S
   lea se
Re
      Code Smart, Don’t Code Hard
?
Code Smart - Makefile (special release)
GCC
....



$ gcc -o hw1 hw1.c
....



$ gcc -o hw2 main.c a.c b.c
$   gcc   -c   main.c #     main.o
$   gcc   -c   a.c #    a.o
$   gcc   -c   b.c #    b.o
$   gcc   -o   hw2 main.o a.o b.o
....?
g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++
-I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/X11R6/
include -I. -o glwidget.o glwidget.cpp
g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++
-I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/X11R6/
include -I. -o main.o main.cpp
g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++
-I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/X11R6/
include -I. -o window.o window.cpp
g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++
-I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/X11R6/
include -I. -o qtlogo.o qtlogo.cpp
/usr/bin/moc-qt4 -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/
qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/X11R6/include -I.
glwidget.h -o moc_glwidget.cpp
g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++
-I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/X11R6/
include -I. -o moc_glwidget.o moc_glwidget.cpp
/usr/bin/moc-qt4 -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/
qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/X11R6/include -I.
window.h -o moc_window.cpp
g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++
-I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/X11R6/
include -I. -o moc_window.o moc_window.cpp
g++ -o hellogl glwidget.o main.o window.o qtlogo.o moc_glwidget.o moc_window.o     -L/usr/lib -L/usr/X11R6/lib -lQtOpenGL -
lQtGui -lQtCore -lGLU -lGL -lpthread
Make?
Code Smart - Makefile (special release)
Makefile
# #




targets: prerequisites
    recipe
    ...   }
Makefile
#

hw1: hw1.c
    gcc -o hw1 hw1.c
    echo “       ”
#                 (       )

main.o: main.c
    gcc -c main.c
a.o: a.c
    gcc -c a.c
b.o: b.c
    gcc -c b.c
hw1: main.o a.o b.o
    gcc -o hw1 main.o a.o b.o
CC = gcc

main.o: main.c
    $(CC) -c main.c
a.o: a.c
    $(CC) -c a.c
b.o: b.c
    $(CC) -c b.c
hw1: main.o a.o b.o
    $(CC) -o hw1 main.o a.o b.o
-
CC = gcc


    pattern rule


                            prerequisite
%.o: %.c
    $(CC) -c $<

hw1: main.o a.o b.o
    $(CC) -o $@ main.o a.o b.o
                   target
CC = gcc
CFLAGS = -Wall -O2
OBJS = main.o a.o b.o
EXEC = hw1

%.o: %.c
    $(CC) $(CFLAGS) -c $<

$(EXEC): $(OBJS)
    $(CC) $(CFLAGS) -o $@ $(OBJS)
....
$   make
g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/
mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/
include/qt4 -I../shared -I/usr/X11R6/include -I. -o glwidget.o glwidget.cpp
g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/
mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/
include/qt4 -I../shared -I/usr/X11R6/include -I. -o main.o main.cpp
g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/
mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/
include/qt4 -I../shared -I/usr/X11R6/include -I. -o window.o window.cpp
g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/
mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/
include/qt4 -I../shared -I/usr/X11R6/include -I. -o qtlogo.o qtlogo.cpp
/usr/bin/moc-qt4 -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/
usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/
X11R6/include -I. glwidget.h -o moc_glwidget.cpp
g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/
mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/
include/qt4 -I../shared -I/usr/X11R6/include -I. -o moc_glwidget.o moc_glwidget.cpp
/usr/bin/moc-qt4 -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/
usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/
X11R6/include -I. window.h -o moc_window.cpp
g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/
mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/
include/qt4 -I../shared -I/usr/X11R6/include -I. -o moc_window.o moc_window.cpp
...
...
g++ -o hellogl glwidget.o main.o window.o qtlogo.o moc_glwidget.o moc_window.o      -L/usr/lib -L/usr/X11R6/lib -
lQtOpenGL -lQtGui -lQtCore -lGLU -lGL -lpthread
$ _
(CrBoy) <crboy@crboy.net>
CC   -             3.0
                ID E-mail
1 of 18

Recommended

Basicsof c make and git for a hello qt application by
Basicsof c make and git for a hello qt applicationBasicsof c make and git for a hello qt application
Basicsof c make and git for a hello qt applicationDinesh Manajipet
563 views16 slides
我在 Mac 上的常用开发工具 by
我在 Mac 上的常用开发工具我在 Mac 上的常用开发工具
我在 Mac 上的常用开发工具dennis zhuang
732 views13 slides
MFC Menu by
MFC MenuMFC Menu
MFC MenuRazvan Raducanu, PhD
68 views31 slides
GLX, DRI, and i965 by
GLX, DRI, and i965GLX, DRI, and i965
GLX, DRI, and i965Chia-I Wu
1.4K views20 slides
Goroutine stack and local variable allocation in Go by
Goroutine stack and local variable allocation in GoGoroutine stack and local variable allocation in Go
Goroutine stack and local variable allocation in GoYu-Shuan Hsieh
340 views30 slides
Biicode OpenExpoDay by
Biicode OpenExpoDayBiicode OpenExpoDay
Biicode OpenExpoDayfcofdezc
625 views62 slides

More Related Content

What's hot

15 3. modulization by
15 3. modulization15 3. modulization
15 3. modulization웅식 전
490 views12 slides
Coding with Vim by
Coding with VimCoding with Vim
Coding with VimEnzo Wang
461 views31 slides
Application of Radare2 Illustrated by Shylock and Snakso.A Analysis by
Application of Radare2 Illustrated by Shylock and Snakso.A AnalysisApplication of Radare2 Illustrated by Shylock and Snakso.A Analysis
Application of Radare2 Illustrated by Shylock and Snakso.A AnalysisPositive Hack Days
3.5K views26 slides
Dev day linux redu by
Dev day linux reduDev day linux redu
Dev day linux reduTarcisio Coutinho
417 views31 slides
Spatial script for MongoBoulder by
Spatial script for MongoBoulderSpatial script for MongoBoulder
Spatial script for MongoBoulderSteven Pousty
431 views2 slides
บทท 7 by
บทท   7บทท   7
บทท 7J-Kitipat Vatinivijet
213 views20 slides

What's hot(20)

15 3. modulization by 웅식 전
15 3. modulization15 3. modulization
15 3. modulization
웅식 전490 views
Coding with Vim by Enzo Wang
Coding with VimCoding with Vim
Coding with Vim
Enzo Wang461 views
Application of Radare2 Illustrated by Shylock and Snakso.A Analysis by Positive Hack Days
Application of Radare2 Illustrated by Shylock and Snakso.A AnalysisApplication of Radare2 Illustrated by Shylock and Snakso.A Analysis
Application of Radare2 Illustrated by Shylock and Snakso.A Analysis
Positive Hack Days3.5K views
Spatial script for MongoBoulder by Steven Pousty
Spatial script for MongoBoulderSpatial script for MongoBoulder
Spatial script for MongoBoulder
Steven Pousty431 views
Python gis by John Zhou
Python gisPython gis
Python gis
John Zhou643 views
C言語静的解析ツールと Ruby 1.9 trunk by ikegami__
C言語静的解析ツールと Ruby 1.9 trunkC言語静的解析ツールと Ruby 1.9 trunk
C言語静的解析ツールと Ruby 1.9 trunk
ikegami__2.9K views
computer project code ''payroll'' (based on datafile handling) by Nitish Yadav
computer project code ''payroll'' (based on datafile handling)computer project code ''payroll'' (based on datafile handling)
computer project code ''payroll'' (based on datafile handling)
Nitish Yadav235 views
HKG15-211: Advanced Toolchain Usage Part 4 by Linaro
HKG15-211: Advanced Toolchain Usage Part 4HKG15-211: Advanced Toolchain Usage Part 4
HKG15-211: Advanced Toolchain Usage Part 4
Linaro4.2K views
An introduction to Hubot - CloudConf 2015 - Turin Italy by Corley S.r.l.
An introduction to Hubot - CloudConf 2015 - Turin ItalyAn introduction to Hubot - CloudConf 2015 - Turin Italy
An introduction to Hubot - CloudConf 2015 - Turin Italy
Corley S.r.l.1.2K views
BASHing at the CLI - Midwest PHP 2018 by Chris Tankersley
BASHing at the CLI - Midwest PHP 2018BASHing at the CLI - Midwest PHP 2018
BASHing at the CLI - Midwest PHP 2018
Chris Tankersley363 views
Linux seccomp(2) vs OpenBSD pledge(2) by Giovanni Bechis
Linux seccomp(2) vs OpenBSD pledge(2)Linux seccomp(2) vs OpenBSD pledge(2)
Linux seccomp(2) vs OpenBSD pledge(2)
Giovanni Bechis3.5K views
Low Overhead System Tracing with eBPF by Akshay Kapoor
Low Overhead System Tracing with eBPFLow Overhead System Tracing with eBPF
Low Overhead System Tracing with eBPF
Akshay Kapoor860 views

Similar to Code Smart - Makefile (special release)

Builder and BuildKit by
Builder and BuildKitBuilder and BuildKit
Builder and BuildKitMoby Project
263 views63 slides
Cloudstack interfaces to EC2 and GCE by
Cloudstack interfaces to EC2 and GCECloudstack interfaces to EC2 and GCE
Cloudstack interfaces to EC2 and GCEShapeBlue
1.4K views25 slides
Happy porting x86 application to android by
Happy porting x86 application to androidHappy porting x86 application to android
Happy porting x86 application to androidOwen Hsu
2.8K views31 slides
Git::Hooks by
Git::HooksGit::Hooks
Git::HooksMikko Koivunalho
875 views22 slides
Magie di git by
Magie di gitMagie di git
Magie di gitmichele franzin
579 views21 slides
Qt native built for raspberry zero by
Qt native built for  raspberry zeroQt native built for  raspberry zero
Qt native built for raspberry zeroSoheilSabzevari2
116 views18 slides

Similar to Code Smart - Makefile (special release)(20)

Builder and BuildKit by Moby Project
Builder and BuildKitBuilder and BuildKit
Builder and BuildKit
Moby Project263 views
Cloudstack interfaces to EC2 and GCE by ShapeBlue
Cloudstack interfaces to EC2 and GCECloudstack interfaces to EC2 and GCE
Cloudstack interfaces to EC2 and GCE
ShapeBlue1.4K views
Happy porting x86 application to android by Owen Hsu
Happy porting x86 application to androidHappy porting x86 application to android
Happy porting x86 application to android
Owen Hsu2.8K views
Using Nix and Docker as automated deployment solutions by Sander van der Burg
Using Nix and Docker as automated deployment solutionsUsing Nix and Docker as automated deployment solutions
Using Nix and Docker as automated deployment solutions
Sander van der Burg6.4K views
C Under Linux by mohan43u
C Under LinuxC Under Linux
C Under Linux
mohan43u1.6K views
Android 5.0 Lollipop platform change investigation report by hidenorly
Android 5.0 Lollipop platform change investigation reportAndroid 5.0 Lollipop platform change investigation report
Android 5.0 Lollipop platform change investigation report
hidenorly10.2K views
Piwik elasticsearch kibana at OSC Tokyo 2016 Spring by Takashi Yamamoto
Piwik elasticsearch kibana at OSC Tokyo 2016 SpringPiwik elasticsearch kibana at OSC Tokyo 2016 Spring
Piwik elasticsearch kibana at OSC Tokyo 2016 Spring
Takashi Yamamoto2.6K views
carrow - Go bindings to Apache Arrow via C++-API by Yoni Davidson
carrow - Go bindings to Apache Arrow via C++-APIcarrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-API
Yoni Davidson452 views
Using Git as your VCS with Bioconductor by timyates
Using Git as your VCS with BioconductorUsing Git as your VCS with Bioconductor
Using Git as your VCS with Bioconductor
timyates444 views
Dependencies Managers in C/C++. Using stdcpp 2014 by biicode
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
biicode4.4K views
Globus toolkit4installationguide by Adarsh Patil
Globus toolkit4installationguideGlobus toolkit4installationguide
Globus toolkit4installationguide
Adarsh Patil361 views
Scaling Development Environments with Docker by Docker, Inc.
Scaling Development Environments with DockerScaling Development Environments with Docker
Scaling Development Environments with Docker
Docker, Inc.8.8K views
GNU Compiler Collection - August 2005 by Saleem Ansari
GNU Compiler Collection - August 2005GNU Compiler Collection - August 2005
GNU Compiler Collection - August 2005
Saleem Ansari1.7K views

Recently uploaded

Cookie Business Plan Example by
Cookie Business Plan ExampleCookie Business Plan Example
Cookie Business Plan ExampleJessica Larson
20 views50 slides
Integrating Talent Management Practices by
Integrating Talent Management PracticesIntegrating Talent Management Practices
Integrating Talent Management PracticesSeta Wicaksana
28 views29 slides
SUGAR cosmetics ppt by
SUGAR cosmetics pptSUGAR cosmetics ppt
SUGAR cosmetics pptshafrinn5
63 views9 slides
Why are KPIs(key performance indicators) important? by
Why are KPIs(key performance indicators) important? Why are KPIs(key performance indicators) important?
Why are KPIs(key performance indicators) important? Epixel MLM Software
11 views17 slides
The Talent Management Navigator Performance Management by
The Talent Management Navigator Performance ManagementThe Talent Management Navigator Performance Management
The Talent Management Navigator Performance ManagementSeta Wicaksana
21 views36 slides
The Truth About Customer Journey Mapping by
The Truth About Customer Journey MappingThe Truth About Customer Journey Mapping
The Truth About Customer Journey MappingAggregage
60 views39 slides

Recently uploaded(20)

Integrating Talent Management Practices by Seta Wicaksana
Integrating Talent Management PracticesIntegrating Talent Management Practices
Integrating Talent Management Practices
Seta Wicaksana28 views
SUGAR cosmetics ppt by shafrinn5
SUGAR cosmetics pptSUGAR cosmetics ppt
SUGAR cosmetics ppt
shafrinn563 views
Why are KPIs(key performance indicators) important? by Epixel MLM Software
Why are KPIs(key performance indicators) important? Why are KPIs(key performance indicators) important?
Why are KPIs(key performance indicators) important?
The Talent Management Navigator Performance Management by Seta Wicaksana
The Talent Management Navigator Performance ManagementThe Talent Management Navigator Performance Management
The Talent Management Navigator Performance Management
Seta Wicaksana21 views
The Truth About Customer Journey Mapping by Aggregage
The Truth About Customer Journey MappingThe Truth About Customer Journey Mapping
The Truth About Customer Journey Mapping
Aggregage60 views
Nevigating Sucess.pdf by TEWMAGAZINE
Nevigating Sucess.pdfNevigating Sucess.pdf
Nevigating Sucess.pdf
TEWMAGAZINE23 views
davood_keshavarz_david_keshavarz_criminal_conviction_prison_sentence_judgemen... by morshedislam3
davood_keshavarz_david_keshavarz_criminal_conviction_prison_sentence_judgemen...davood_keshavarz_david_keshavarz_criminal_conviction_prison_sentence_judgemen...
davood_keshavarz_david_keshavarz_criminal_conviction_prison_sentence_judgemen...
morshedislam312 views
Top 10 IT Tasks Small Businesses Can Entrust to Offshore Professionals by altafhsayyednimetler
Top 10 IT Tasks Small Businesses Can Entrust to Offshore ProfessionalsTop 10 IT Tasks Small Businesses Can Entrust to Offshore Professionals
Top 10 IT Tasks Small Businesses Can Entrust to Offshore Professionals
Pitch Deck Teardown: Scalestack's $1M AI sales tech Seed deck by HajeJanKamps
Pitch Deck Teardown: Scalestack's $1M AI sales tech Seed deckPitch Deck Teardown: Scalestack's $1M AI sales tech Seed deck
Pitch Deck Teardown: Scalestack's $1M AI sales tech Seed deck
HajeJanKamps417 views
Coomes Consulting Business Profile by Chris Coomes
Coomes Consulting Business ProfileCoomes Consulting Business Profile
Coomes Consulting Business Profile
Chris Coomes46 views
bookmyshow-1.pptx by 125071035
bookmyshow-1.pptxbookmyshow-1.pptx
bookmyshow-1.pptx
12507103511 views
voice logger software aegis.pdf by Nirmal Sharma
voice logger software aegis.pdfvoice logger software aegis.pdf
voice logger software aegis.pdf
Nirmal Sharma30 views

Code Smart - Makefile (special release)

  • 1. pe cial S lea se Re Code Smart, Don’t Code Hard
  • 2. ?
  • 4. GCC
  • 5. .... $ gcc -o hw1 hw1.c
  • 6. .... $ gcc -o hw2 main.c a.c b.c
  • 7. $ gcc -c main.c # main.o $ gcc -c a.c # a.o $ gcc -c b.c # b.o $ gcc -o hw2 main.o a.o b.o
  • 8. ....? g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/X11R6/ include -I. -o glwidget.o glwidget.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/X11R6/ include -I. -o main.o main.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/X11R6/ include -I. -o window.o window.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/X11R6/ include -I. -o qtlogo.o qtlogo.cpp /usr/bin/moc-qt4 -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/ qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/X11R6/include -I. glwidget.h -o moc_glwidget.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/X11R6/ include -I. -o moc_glwidget.o moc_glwidget.cpp /usr/bin/moc-qt4 -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/ qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/X11R6/include -I. window.h -o moc_window.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/X11R6/ include -I. -o moc_window.o moc_window.cpp g++ -o hellogl glwidget.o main.o window.o qtlogo.o moc_glwidget.o moc_window.o -L/usr/lib -L/usr/X11R6/lib -lQtOpenGL - lQtGui -lQtCore -lGLU -lGL -lpthread
  • 12. Makefile # hw1: hw1.c gcc -o hw1 hw1.c echo “ ”
  • 13. # ( ) main.o: main.c gcc -c main.c a.o: a.c gcc -c a.c b.o: b.c gcc -c b.c hw1: main.o a.o b.o gcc -o hw1 main.o a.o b.o
  • 14. CC = gcc main.o: main.c $(CC) -c main.c a.o: a.c $(CC) -c a.c b.o: b.c $(CC) -c b.c hw1: main.o a.o b.o $(CC) -o hw1 main.o a.o b.o
  • 15. - CC = gcc pattern rule prerequisite %.o: %.c $(CC) -c $< hw1: main.o a.o b.o $(CC) -o $@ main.o a.o b.o target
  • 16. CC = gcc CFLAGS = -Wall -O2 OBJS = main.o a.o b.o EXEC = hw1 %.o: %.c $(CC) $(CFLAGS) -c $< $(EXEC): $(OBJS) $(CC) $(CFLAGS) -o $@ $(OBJS)
  • 17. .... $ make g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/ mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/ include/qt4 -I../shared -I/usr/X11R6/include -I. -o glwidget.o glwidget.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/ mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/ include/qt4 -I../shared -I/usr/X11R6/include -I. -o main.o main.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/ mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/ include/qt4 -I../shared -I/usr/X11R6/include -I. -o window.o window.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/ mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/ include/qt4 -I../shared -I/usr/X11R6/include -I. -o qtlogo.o qtlogo.cpp /usr/bin/moc-qt4 -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/ usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/ X11R6/include -I. glwidget.h -o moc_glwidget.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/ mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/ include/qt4 -I../shared -I/usr/X11R6/include -I. -o moc_glwidget.o moc_glwidget.cpp /usr/bin/moc-qt4 -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/ usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4 -I../shared -I/usr/ X11R6/include -I. window.h -o moc_window.cpp g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/ mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/ include/qt4 -I../shared -I/usr/X11R6/include -I. -o moc_window.o moc_window.cpp ... ... g++ -o hellogl glwidget.o main.o window.o qtlogo.o moc_glwidget.o moc_window.o -L/usr/lib -L/usr/X11R6/lib - lQtOpenGL -lQtGui -lQtCore -lGLU -lGL -lpthread $ _
  • 18. (CrBoy) <crboy@crboy.net> CC - 3.0 ID E-mail