reed@android.com | 4cb8bd1 | 2009-01-16 16:15:37 +0000 | [diff] [blame^] | 1 | |
| 2 | CC = gcc |
| 3 | C_INCLUDES := -Iinclude/core -Iinclude/effects -Iinclude/images -Iinclude/utils |
| 4 | CFLAGS = -O2 |
| 5 | DEFINES = -DSK_BUILD_FOR_UNIX |
| 6 | HIDE = @ |
| 7 | |
| 8 | #DEFINES += -DSK_RELEASE |
| 9 | DEFINES += -DSK_DEBUG -DSK_SUPPORT_UNITTEST |
| 10 | #DEFINES += -DSK_SCALAR_IS_FIXED |
| 11 | |
| 12 | # start with the core (required) |
| 13 | include src/core/core_files.mk |
| 14 | SRC_LIST := $(addprefix src/core/, $(SOURCE)) |
| 15 | |
| 16 | # we usually need ports |
| 17 | include src/ports/ports_files.mk |
| 18 | SRC_LIST += $(addprefix src/ports/, $(SOURCE)) |
| 19 | |
| 20 | # do we want effects? |
| 21 | include src/effects/effects_files.mk |
| 22 | SRC_LIST += $(addprefix src/effects/, $(SOURCE)) |
| 23 | |
| 24 | out/%.o : %.cpp |
| 25 | @mkdir -p $(dir $@) |
| 26 | $(HIDE)$(CC) $(C_INCLUDES) $(CFLAGS) $(DEFINES) -c $< -o $@ |
| 27 | @echo "compiling $@" |
| 28 | |
| 29 | # now build out objects |
| 30 | OBJ_LIST := $(SRC_LIST:.cpp=.o) |
| 31 | OBJ_LIST := $(addprefix out/, $(OBJ_LIST)) |
| 32 | |
| 33 | out/libskia.a: Makefile $(OBJ_LIST) |
| 34 | $(HIDE)$(AR) ru $@ $(OBJ_LIST) |
| 35 | $(HIDE)ranlib $@ |
| 36 | |
| 37 | BENCH_SRCS := RectBench.cpp SkBenchmark.cpp main.cpp |
| 38 | BENCH_SRCS := $(addprefix bench/, $(BENCH_SRCS)) |
| 39 | BENCH_OBJS := $(BENCH_SRCS:.cpp=.o) |
| 40 | BENCH_OBJS := $(addprefix out/, $(BENCH_OBJS)) |
| 41 | |
| 42 | bench: $(BENCH_OBJS) out/libskia.a |
| 43 | g++ $(BENCH_OBJS) out/libskia.a -o out/bench/bench |
| 44 | |
| 45 | clean: |
| 46 | $(HIDE)rm -rf out |
| 47 | |