digital adj. Having digits.     peer n. A comrade; a companion; a fellow; an associate. inmotion    
   
Recent Articles
Stop DNSMasq From Forwarding Local Hostnames
Saturday, September 25, 2010
Securing your Wireless LAN
Wednesday, August 18, 2010
Some tips and things you might not know about your wireless network.
Using Different Subversion Client Versions
Wednesday, August 18, 2010
Handling a Subversion Repository URL Change
Sunday, May 3, 2009
If your repository URL changes, you can use the following command to fix existing snapshots.
vfat Mounts Default to Lowercase Shortnames
Tuesday, April 21, 2009
I want a "this is brain-damage" quote from Linus for this mess.
VirtualBox or VMWare Virtual Machine at Login
Sunday, April 12, 2009
How to start a virtual machine in X when a user logs in.
Dialog Progress Bar Through Pipe
Sunday, April 12, 2009
How to use dialog to display a script progress bar and communicate progress to it through a named pipe.
Mount JFFS2 Image
Saturday, October 25, 2008
Example of how to mount a JFFS2 image using mtdblock.

Never tell the truth to people who are not worthy of it.
- Mark Twain

Projects-Example...

Example Makefile for Static Library

Monday, January 10, 2005 by digitalpeer

This is just a simple example. There's always the option of looking at a more complete manual.
# source files.
SRC =  	file1.cpp file2.cpp file3.cpp

OBJ = $(SRC:.cpp=.o)

OUT = ../libutils.a

# include directories
INCLUDES = -I. -I../include/ -I/usr/local/include

# C++ compiler flags (-g -O2 -Wall)
CCFLAGS = -g

# compiler
CCC = g++

# library paths
LIBS = -L../ -L/usr/local/lib -lm

# compile flags
LDFLAGS = -g

.SUFFIXES: .cpp

default: dep $(OUT)

.cpp.o:
	$(CCC) $(INCLUDES) $(CCFLAGS) -c $< -o $@

$(OUT): $(OBJ)
	ar rcs $(OUT) $(OBJ)

depend: dep

dep:
	makedepend -- $(CFLAGS) -- $(INCLUDES) $(SRC)

clean:
	rm -f $(OBJ) $(OUT) Makefile.bak 

External Links Summary
GNU make - Table of Contents [theory.uwinnipeg.ca]
Comment Wednesday, March 3, 2010 by  anonymous
give a fucking output maybe?
Comment Wednesday, March 3, 2010 by  digitalpeer
compile some code and you'll get some fucking output.
Comment Thursday, March 11, 2010 by  gabriel
Hi,

Thanks for the example. It is just what I was looking for and works fine.

gabriel
Comment Wednesday, October 6, 2010 by  by mikev
nice example, i dont know what the problem with the other guys was.

Also if all your directory .cpp files are sources you can do like that:


SRC := $(wildcard *.cpp)
Comment Tuesday, May 10, 2011 by  anon
Thanks!
Comment Wednesday, August 3, 2011 by  bob flob
@anonymous (3/3/10) get your own fucking output ;)
Comment Wednesday, October 12, 2011 by  anonymouse
@anonymous : fuck you and all your outputs

Submit Comment to This Article
Please post a comment if you have something to add, find something wrong, or would like more information on the topic at hand. Do not use the comment form to contact the author about unrelated concerns!

Name: Email (optional):
Enter verification number here: