[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Request for critique on a small makefile
From: |
Edward Z. Yang |
Subject: |
Request for critique on a small makefile |
Date: |
Mon, 11 Dec 2006 21:21:09 -0500 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041206 Thunderbird/1.0 Mnenhy/0.6.0.104 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I am currently working my way through a dozen or so exercises to get in
touch with the language features of C++. On the second exercise, I
needed to parse command line options, so I opted to use the Boost
library. Unfortunantely, linking them up is somewhat complicated, so I
decided to learn how to write Makefiles.
So, here is a fairly simple Makefile that works. I would like to know if
I did anything wrong, went against any good practice, i.e. did anything
that could become a bad habit. How portable is this Makefile? Thanks!
error_mode = -ansi -pedantic
cc = g++ $(error_mode)
boost = /usr/include/boost-1_33_1
boost_program_options = boost_program_options-gcc-mt-s
programs = fibonacci.exe printNumbers.exe
all : fibonacci printNumbers
objects/fibonacci.o :
$(cc) -c -I $(boost) -o objects/fibonacci.o fibonacci.cpp
fibonacci : objects/fibonacci.o
$(cc) -o fibonacci.exe objects/fibonacci.o -l $(boost_program_options)
printNumbers :
$(cc) -o printNumbers.exe printNumbers.cpp
clean :
rm $(programs) objects/*
- --
Edward Z. Yang Personal: address@hidden
SN:Ambush Commander Website: http://www.thewritingpot.com/
GPGKey:0x869C48DA http://www.thewritingpot.com/gpgpubkey.asc
3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFfhIVqTO+fYacSNoRAreBAJsG81BAunuuO/nEWD2yLTw64/q6XACcCObW
J6/KwDHLWWNq/TPobb6Z+Hs=
=r9hV
-----END PGP SIGNATURE-----
- Request for critique on a small makefile,
Edward Z. Yang <=
- Re: Request for critique on a small makefile, Philip Guenther, 2006/12/12
- Re: Request for critique on a small makefile, Edward Z. Yang, 2006/12/12
- Re: Request for critique on a small makefile, Philip Guenther, 2006/12/12
- Re: Request for critique on a small makefile, Edward Z. Yang, 2006/12/12
- Re: Request for critique on a small makefile, Philip Guenther, 2006/12/12
- Re: Request for critique on a small makefile, Edward Z. Yang, 2006/12/12
- Re: Request for critique on a small makefile, Greg Chicares, 2006/12/12
- Re: Request for critique on a small makefile, Greg Chicares, 2006/12/12