ccdemos/Makefile
branchpyrit
changeset 20 f22952603f29
parent 16 20bceb605f48
child 22 76b7bd51d64a
equal deleted inserted replaced
19:4e0955fca797 20:f22952603f29
     1 CCFLAGS=-g -O0 -I../src
     1 CCFLAGS=-g -O3 -I../src
     2 LDFLAGS=-L.. -lpng `python-config --libs`
     2 LDFLAGS=-L.. -pthread
     3 objs=image.o ../*.o
     3 RGBLIB_LDFLAGS=$(LDFLAGS) -lpng
       
     4 SDL_CCFLAGS=$(CCFLAGS) $(shell sdl-config --cflags)
       
     5 SDL_LDFLAGS=$(LDFLAGS) $(shell sdl-config --libs)
       
     6 PYRIT_OBJS=$(shell ls ../*.o | grep -v raytracermodule)
     4 
     7 
     5 all: image.o spheres_shadow
     8 all: spheres_shadow realtime
     6 
     9 
     7 %.o: %.c
    10 %.o: %.c
     8 	$(CXX) -c -o $@ $*.c
    11 	$(CXX) -c -o $@ $*.c
     9 
    12 
    10 %.o: %.cc
    13 %.o: %.cc
    11 	$(CXX) -c -o $@ $*.cc $(CCFLAGS)
    14 	$(CXX) -c -o $@ $*.cc $(CCFLAGS)
    12 
    15 
    13 %: %.o
    16 %: %.o
    14 	(cd .. && make)
    17 	(cd .. && make)
    15 	$(CXX) -o $@ $(objs) $*.o $(LDFLAGS)
    18 	$(CXX) -o $@ $(PYRIT_OBJS) $^ $(RGBLIB_LDFLAGS)
    16 
    19 
    17 image.o: image.c
    20 image.o: image.c
    18 spheres_shadow.o: spheres_shadow.cc
    21 spheres_shadow.o: spheres_shadow.cc
    19 spheres_shadow: spheres_shadow.o
    22 spheres_shadow: spheres_shadow.o image.o
       
    23 
       
    24 realtime: realtime.cc
       
    25 	$(CXX) -o $@ $@.cc $(SDL_CCFLAGS) -L.. $(PYRIT_OBJS) $(SDL_LDFLAGS)
    20 
    26 
    21 clean:
    27 clean:
    22 	rm -f spheres_shadow *.o
    28 	rm -f spheres_shadow realtime *.o