ccdemos/Makefile
branchpyrit
changeset 22 76b7bd51d64a
parent 20 f22952603f29
child 24 d0d76e8a5203
equal deleted inserted replaced
21:79b516a3803d 22:76b7bd51d64a
     1 CCFLAGS=-g -O3 -I../src
     1 ifndef $(ROOT)
     2 LDFLAGS=-L.. -pthread
     2 	ROOT=$(shell pwd)/..
     3 RGBLIB_LDFLAGS=$(LDFLAGS) -lpng
     3 endif
     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)
       
     7 
     4 
     8 all: spheres_shadow realtime
     5 include $(ROOT)/config.mk
     9 
     6 
    10 %.o: %.c
     7 
       
     8 ### Targets ###
       
     9 all: realtime spheres_shadow
       
    10 
       
    11 realtime: realtime.o libs-double
       
    12 	$(CXX) -o $@ $(ROOT)/bin/libs-double/*.o $< $(LDFLAGS) $(SDL_LDFLAGS)
       
    13 
       
    14 spheres_shadow: spheres_shadow.o image.o libs-float
       
    15 	$(CXX) -o $@ $(ROOT)/bin/libs-float/*.o $< image.o $(LDFLAGS) -lpng
       
    16 
       
    17 libs-float:
       
    18 	$(MAKE) -C ../src libs-float
       
    19 
       
    20 libs-double:
       
    21 	$(MAKE) -C ../src libs-double
       
    22 
       
    23 realtime.o: realtime.cc
       
    24 	$(CXX) -c -o $@ $(CCFLAGS) $(SDL_CCFLAGS) $< $(DEFS) -DPYRIT_DOUBLE
       
    25 
       
    26 image.o: image.c
    11 	$(CXX) -c -o $@ $*.c
    27 	$(CXX) -c -o $@ $*.c
    12 
    28 
    13 %.o: %.cc
       
    14 	$(CXX) -c -o $@ $*.cc $(CCFLAGS)
       
    15 
       
    16 %: %.o
       
    17 	(cd .. && make)
       
    18 	$(CXX) -o $@ $(PYRIT_OBJS) $^ $(RGBLIB_LDFLAGS)
       
    19 
       
    20 image.o: image.c
       
    21 spheres_shadow.o: spheres_shadow.cc
    29 spheres_shadow.o: spheres_shadow.cc
    22 spheres_shadow: spheres_shadow.o image.o
    30 	$(CXX) -c -o $@ $*.cc $(CCFLAGS) $(DEFS)
    23 
       
    24 realtime: realtime.cc
       
    25 	$(CXX) -o $@ $@.cc $(SDL_CCFLAGS) -L.. $(PYRIT_OBJS) $(SDL_LDFLAGS)
       
    26 
    31 
    27 clean:
    32 clean:
    28 	rm -f spheres_shadow realtime *.o
    33 	rm -f spheres_shadow realtime *.o