src/work/makefile
changeset 34 2b607665c9e2
parent 7 0f527d1b9149
child 38 edea2e1dc6ef
     1.1 --- a/src/work/makefile	Fri Jan 23 22:26:13 2004 +0000
     1.2 +++ b/src/work/makefile	Sun Jan 25 18:33:17 2004 +0000
     1.3 @@ -1,26 +1,34 @@
     1.4 -CXXFLAGS=-g -Wall -I../include
     1.5 +CXXFLAGS=-g -O -Wall -I../include -I.
     1.6  
     1.7 -none:
     1.8 -	@echo 'Please use one of these forms:'
     1.9 -	@echo '   make all'
    1.10 -	@echo '   make clean'
    1.11 -	@echo '   make graphdemo'
    1.12 -	@echo '   make bfsdemo'
    1.13 -	@echo '   make bfsdemo2'
    1.14 +BINARIES = graphdemo bfsdemo bfsdemo2 proba
    1.15  
    1.16 -all: graphdemo bfsdemo bfsdemo2
    1.17 +# Hat, ez elismerem, hogy nagyon ronda, de mukodik minden altalam
    1.18 +# ismert rendszeren :-)  (Misi)
    1.19 +CXX := $(shell type -p g++-3.3 || type -p g++-3.2 || type -p g++-3.0 || type -p g++-3 || echo g++)
    1.20 +CC := $(CXX)
    1.21 +
    1.22 +
    1.23 +all: $(BINARIES)
    1.24 +
    1.25 +################
    1.26 +# Minden binarishoz egy sor, felsorolva, hogy mely object file-okbol
    1.27 +# all elo.
    1.28 +# Kiveve ha siman file.cc -> file  esetrol van szo, amikor is nem kell
    1.29 +# irni semmit.
    1.30 +
    1.31 +#proba: proba.o seged.o
    1.32 +
    1.33 +################
    1.34 +
    1.35 +dep depend:
    1.36 +	$(CXX) $(CXXFLAGS) -MM *.cc > .depend
    1.37 +.depend:
    1.38 +	$(CXX) $(CXXFLAGS) -MM *.cc > .depend
    1.39 +
    1.40 +makefile: .depend
    1.41 +sinclude .depend
    1.42  
    1.43  clean:
    1.44 -	rm graphdemo bfsdemo bfsdemo2
    1.45 +	$(RM) *.o $(BINARIES) .depend
    1.46  
    1.47 -graphdemo: graphdemo.cc ../include/graph.h \
    1.48 -	../include/oldgraph.h makefile
    1.49 -	g++ $(CXXFLAGS) -o graphdemo graphdemo.cc
    1.50 -
    1.51 -bfsdemo: bfsdemo.cc ../include/graph.h ../include/bfs.h \
    1.52 -	../include/oldgraph.h makefile
    1.53 -	g++ $(CXXFLAGS) -o bfsdemo bfsdemo.cc
    1.54 -
    1.55 -bfsdemo2: bfsdemo2.cc ../include/graph.h ../include/bfs.h \
    1.56 -	../include/oldgraph.h makefile
    1.57 -	g++ $(CXXFLAGS) -o bfsdemo2 bfsdemo2.cc
    1.58 +.PHONY: all clean dep depend