[geeks] Makefile question

Joshua D Boyd jdboyd at cs.millersville.edu
Sat Nov 9 01:00:04 CST 2002


I've been going back and forth oer the gnu make manual on the gnu.org
web site, and I just can't figure out how to modify my Makefile to allow
parallel compilation with make -j2.  Here is the simple Makefile.

CC = g++;

muopengl.a: *.o
	    $(CC) -shared *.o -o muopengl.a
	    mv muopengl.a ../mulib/
	    cp include/*.h ../mulib/include/

*.o: 
     $(CC) -c src/*.cpp -Iinclude -I../mulib/include -I../mulib

.PHONY: clean
clean:
	rm *.o

I really don't know much about makefiles.  My needs have always been
simpler if the past, but this time I need to make a set of make files
that builds some libraries (this is the makefile for one of the
libraries) first before compiling the actual program, imitating the way
a Visual Studio project is compiled (so that I can continue working on
it on linux at home safe in the knowledge that my changes will work when
I return to visual studio on monday).



-- 
Joshua D. Boyd



More information about the geeks mailing list