[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Makefile



Hej,

Hvordan får jeg make til selv at finde ud af de relevante kommandoer til
at linke flere C++ .o filer sammen til en eksekverbar binary?

I nedenstående eksempel bliver main.o og bar.o fint kompileret, men jeg
vil jo gerne have dem linket sammen til en binær fil kaldet foo? Hvordan
gøres dette (hvordan får jeg make til automagisk at finde den relevante
kommando?)

Eksempel:

CXXFLAGS := $(CXXFLAGS) -ansi -pedantic -Wall

all: foo

foo: main.o bar.o

main.o: main.cpp bar.h

bar.o: bar.cpp bar.h

.PHONY: clean
clean: 
	-rm main.o bar.o foo

-- 
Henrik Brix Andersen <sslug@sslug>



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:09 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *