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