ccdemos/Makefile
branchpyrit
changeset 63 440e1ae80459
parent 62 07c2f8084719
child 64 5785cca4cdb9
equal deleted inserted replaced
62:07c2f8084719 63:440e1ae80459
     1 ifndef $(ROOT)
       
     2 	ROOT=$(shell pwd)/..
       
     3 endif
       
     4 
       
     5 include $(ROOT)/config.mk
       
     6 
       
     7 ### single precision
       
     8 #RTLIBS=libs-float
       
     9 #CCFLAGS+=-fsingle-precision-constant
       
    10 
       
    11 ### double precision
       
    12 RTLIBS=libs-double
       
    13 CCFLAGS+=-DPYRIT_DOUBLE
       
    14 
       
    15 
       
    16 ### Rules ###
       
    17 %.o: %.cc
       
    18 	$(CXX) -c -o $@ $(CCFLAGS) $(SDL_CCFLAGS) $<
       
    19 
       
    20 %: %.o
       
    21 	$(CXX) -o $@ $(ROOT)/bin/$(RTLIBS)/*.o $< image.o $(LDFLAGS) $(SDL_LDFLAGS) -lpng
       
    22 
       
    23 ### Targets ###
       
    24 all: realtime realtime_dragon realtime_bunny spheres_shadow textures
       
    25 
       
    26 realtime: realtime.o $(RTLIBS) image.o
       
    27 realtime_dragon: realtime_dragon.o $(RTLIBS) image.o
       
    28 realtime_bunny: realtime_bunny.o $(RTLIBS) image.o
       
    29 spheres_shadow: spheres_shadow.o $(RTLIBS) image.o
       
    30 textures: textures.o $(RTLIBS) image.o
       
    31 
       
    32 realtime.o: realtime.cc common_sdl.h
       
    33 realtime_dragon.o: realtime_dragon.cc common_sdl.h common_ply.h
       
    34 realtime_bunny.o: realtime_bunny.cc common_sdl.h common_ply.h
       
    35 spheres_shadow.o: spheres_shadow.cc common_sdl.h
       
    36 textures.o: textures.cc common_sdl.h
       
    37 
       
    38 libs-float:
       
    39 	$(MAKE) -C ../src libs-float
       
    40 
       
    41 libs-double:
       
    42 	$(MAKE) -C ../src libs-double
       
    43 
       
    44 image.o: image.c
       
    45 	$(CXX) -c -o $@ $*.c
       
    46 
       
    47 clean:
       
    48 	rm -f realtime realtime_dragon realtime_bunny spheres_shadow textures *.o
       
    49 
       
    50 distclean: clean
       
    51 	rm -rf *.png