-# Simple makefile for skia library and test apps
+# Makefile that redirects almost all make directives to the gyp-generated Makefile.
+#
+# Note that this method of building works only on Unix (not Mac or Windows).
+# See http://code.google.com/p/skia/wiki/DocRoot for complete documentation.
-# setup our defaults
-CC := gcc
-GPP := g++
-C_INCLUDES := -Iinclude/config -Iinclude/core -Iinclude/effects -Iinclude/images -Iinclude/ports
-C_INCLUDES += -Iinclude/gpu -Iinclude/utils -Igpu/include
-C_INCLUDES += -Ithird_party/glu
+# Directory within which we want all generated files to be written.
+outdir := out
-CFLAGS := -Wall -fstrict-aliasing
-#CFLAGS += -W -Wextra -Wcast-align -Wchar-subscripts -Wformat -Wformat-security -Wno-format-y2k -Wno-parentheses -Wno-unused-parameter -Wpointer-arith -Wreturn-type -Wundef -Wwrite-strings
-CFLAGS_SSE2 = $(CFLAGS) -msse2
-LINKER_OPTS := -lpthread -lz
-DEFINES := -DSK_CAN_USE_FLOAT
-HIDE = @
-
-ifeq ($(SKIA_SCALAR),fixed)
- DEFINES += -DSK_SCALAR_IS_FIXED
-else
- DEFINES += -DSK_SCALAR_IS_FLOAT
-endif
-
-ifeq ($(SKIA_DEBUG),true)
- DEFINES += -DSK_DEBUG -DSK_SUPPORT_UNIT -DGR_DEBUG=1
- CFLAGS += -g
-else
- CFLAGS += -O3
- DEFINES += -DSK_RELEASE -DGR_DEBUG=0
-endif
-
-DEFINES += -DGR_IMPLEMENTATION=1
-
-ifneq ($(SKIA_PDF_SUPPORT),false)
- DEFINES += -DSK_SUPPORT_PDF
- DEFINES += -DSK_ZLIB_INCLUDE="<zlib.h>"
-endif
-
-ifeq ($(SKIA_SHARED),true)
- CFLAGS += -fPIC
- LIBSKIA = out/libskia.so
-else
- LIBSKIA = out/libskia.a
-endif
-
-# start with the core (required)
-include src/core/core_files.mk
-SRC_LIST := $(addprefix src/core/, $(SOURCE))
-
-# add the opts (optimizations)
-include src/opts/opts_sse2_files.mk
-#include src/opts/opts_files.mk
-SRC_LIST += $(addprefix src/opts/, $(SOURCE))
-
-# we usually need ports
-include src/ports/ports_files.mk
-SRC_LIST += $(addprefix src/ports/, $(SOURCE))
-
-# do we want effects?
-include src/effects/effects_files.mk
-SRC_LIST += $(addprefix src/effects/, $(SOURCE))
-
-# core image files
-include src/images/images_files.mk
-SRC_LIST += $(addprefix src/images/, $(SOURCE))
-
-# core util files
-include src/utils/utils_files.mk
-SRC_LIST += $(addprefix src/utils/, $(SOURCE))
-
-# GPU files
-include gpu/src/gr_files.mk
-SRC_LIST += $(addprefix gpu/src/, $(SOURCE))
-
-# GPU support files
-include src/gpu/skgr_files.mk
-SRC_LIST += $(addprefix src/gpu/, $(SOURCE))
-
-# pdf backend files
-ifneq ($(SKIA_PDF_SUPPORT),false)
- C_INCLUDES += -Iinclude/pdf
- include src/pdf/pdf_files.mk
- SRC_LIST += $(addprefix src/pdf/, $(SOURCE))
-endif
-
-# extra files we want to build to prevent bit-rot, but not link
-JUST_COMPILE_LIST := src/ports/SkFontHost_tables.cpp
-
-# conditional files based on our platform
-ifeq ($(SKIA_BUILD_FOR),mac)
- # make it work with 10.4 for our font port
-# GPP := g++-4.0
-# SDK := /Developer/SDKs/MacOSX10.4u.sdk
-# SDK_OPTS := -isysroot $(SDK) -mmacosx-version-min=10.4
-# CC := gcc-4.0 $(SDK_OPTS)
-
- C_INCLUDES += -I/opt/local/include
- LINKER_OPTS += -L/opt/local/lib -framework Carbon -lpng
- DEFINES += -DSK_BUILD_FOR_MAC -DSK_ENABLE_LIBPNG
- ifeq ($(SKIA_MESA),true)
- C_INCLUDES += -I/usr/X11/include
- LINKER_OPTS += -L/usr/X11/lib -lOSMesa -lGLU
- DEFINES += -DSK_MESA
- else
- LINKER_OPTS += -framework OpenGL -framework AGL
- endif
- C_INCLUDES += -Iinclude/utils/mac
-# SRC_LIST += src/ports/SkImageDecoder_CG.cpp
- SRC_LIST += src/utils/mac/SkCreateCGImageRef.cpp
- ifeq ($(SKIA_MESA),true)
- SRC_LIST += src/utils/mesa/SkEGLContext_Mesa.cpp
- else
- SRC_LIST += src/utils/mac/SkEGLContext_mac.cpp
- endif
- SRC_LIST += src/core/SkTypefaceCache.cpp
- SRC_LIST += src/ports/SkFontHost_mac_coretext.cpp
-
- # these are our registry-based factories
- SRC_LIST += src/images/SkImageDecoder_Factory.cpp
- SRC_LIST += src/images/SkImageEncoder_Factory.cpp
- SRC_LIST += src/images/SkImageDecoder_libpng.cpp
- # support files
- SRC_LIST += src/images/SkScaledBitmapSampler.cpp
-
- ifeq ($(SKIA_MESA),true)
- SRC_LIST += gpu/src/mesa/GrGLDefaultInterface_mesa.cpp
- else
- SRC_LIST += gpu/src/mac/GrGLDefaultInterface_mac.cpp
- endif
-
-else
- LINKER_OPTS += -lpng -lfreetype
- DEFINES += -DSK_BUILD_FOR_UNIX -DSK_ENABLE_LIBPNG -DGR_LINUX_BUILD=1
- ifeq ($(SKIA_MESA),true)
- LINKER_OPTS += -lOSMesa -lGLU
- DEFINES += -DSK_MESA
- else
- LINKER_OPTS += -lGL -lGLU -lX11
- endif
-
- #Assume the color order for now.
- DEFINES += -DSK_SAMPLES_FOR_X
-
- # needed for freetype support
- C_INCLUDES += -I/usr/include/freetype2
- SRC_LIST += src/ports/SkFontHost_linux.cpp
- SRC_LIST += src/ports/SkFontHost_gamma_none.cpp
- SRC_LIST += src/ports/SkFontHost_FreeType.cpp
- SRC_LIST += src/ports/SkFontHost_FreeType_Subpixel.cpp
- ifeq ($(SKIA_MESA),true)
- SRC_LIST += src/utils/mesa/SkEGLContext_Mesa.cpp
- else
- SRC_LIST += src/utils/unix/SkEGLContext_Unix.cpp
- endif
- # these are our registry-based factories
- SRC_LIST += src/images/SkImageDecoder_Factory.cpp
- SRC_LIST += src/images/SkImageEncoder_Factory.cpp
- SRC_LIST += src/images/SkImageDecoder_libpng.cpp
- # support files
- SRC_LIST += src/images/SkScaledBitmapSampler.cpp
-
- ifeq ($(SKIA_MESA),true)
- SRC_LIST += gpu/src/mesa/GrGLDefaultInterface_mesa.cpp
- else
- SRC_LIST += gpu/src/unix/GrGLDefaultInterface_unix.cpp
- endif
-endif
-
-# For these files, and these files only, compile with -msse2.
-SSE2_OBJS := out/src/opts/SkBlitRow_opts_SSE2.o \
- out/src/opts/SkBitmapProcState_opts_SSE2.o \
- out/src/opts/SkUtils_opts_SSE2.o
-$(SSE2_OBJS) : CFLAGS := $(CFLAGS_SSE2)
-
-out/%.o : %.cpp
- @mkdir -p $(dir $@)
- $(HIDE)$(CC) $(C_INCLUDES) $(CFLAGS) $(DEFINES) -c $< -o $@
- @echo "compiling $@"
-
-%.s : %.cpp
- @mkdir -p $(dir $@)
- $(CC) $(C_INCLUDES) $(CFLAGS) $(DEFINES) -S -c $< -o $@
-
-# now build out objects
-OBJ_LIST := $(SRC_LIST:.cpp=.o)
-OBJ_LIST := $(addprefix out/, $(OBJ_LIST))
-
-# we want to compile these, but we don't actually link them
-JUST_COMPILE_OBJS := $(JUST_COMPILE_LIST:.cpp=.o)
-JUST_COMPILE_OBJS := $(addprefix out/, $(JUST_COMPILE_OBJS))
-
-out/libskia.a: Makefile $(OBJ_LIST) $(JUST_COMPILE_OBJS)
- $(HIDE)$(AR) ru $@ $(OBJ_LIST)
- $(HIDE)ranlib $@
-
-out/libskia.so: Makefile $(OBJ_LIST) $(JUST_COMPILE_OBJS)
- $(HIDE)$(GPP) -shared -o $@ $(OBJ_LIST) $(JUST_COMPILE_OBJS) $(LINKER_OPTS)
-
-##############################################################################
-
-BENCH_SRCS := RectBench.cpp SkBenchmark.cpp benchmain.cpp BitmapBench.cpp \
- RepeatTileBench.cpp DecodeBench.cpp FPSBench.cpp PathBench.cpp \
- GradientBench.cpp MatrixBench.cpp ScalarBench.cpp
-
-BENCH_SRCS := $(addprefix bench/, $(BENCH_SRCS))
-
-# add any optional codecs for this app
-ifeq ($(SKIA_BUILD_FOR),mac)
- BENCH_SRCS += bench/TextBench.cpp
-else
- BENCH_SRCS += src/images/SkImageDecoder_libpng.cpp
-endif
-
-BENCH_OBJS := $(BENCH_SRCS:.cpp=.o)
-BENCH_OBJS := $(addprefix out/, $(BENCH_OBJS))
-
-bench: $(BENCH_OBJS) $(LIBSKIA)
- @echo "linking bench..."
- $(HIDE)$(GPP) $(BENCH_OBJS) $(LIBSKIA) -o out/bench/bench $(LINKER_OPTS)
-
-##############################################################################
-
-# we let tests cheat and see private headers, so we can unittest modules
-C_INCLUDES += -Isrc/core
-
-include tests/tests_files.mk
-ifneq ($(SKIA_PDF_SUPPORT),false)
- SOURCE += PDFPrimitivesTest.cpp
+# GYP-generated Makefiles only work on Linux/Unix (not Mac or Windows).
+uname := $(shell uname)
+ifneq (,$(findstring Darwin, $(uname)))
+ $(error Cannot build using Make on Mac. See http://code.google.com/p/skia/wiki/GettingStartedOnMac)
endif
-TESTS_SRCS := $(addprefix tests/, $(SOURCE))
-
-TESTS_OBJS := $(TESTS_SRCS:.cpp=.o)
-TESTS_OBJS := $(addprefix out/, $(TESTS_OBJS))
-
-tests: $(TESTS_OBJS) $(LIBSKIA)
- @echo "linking tests..."
- $(HIDE)$(GPP) $(TESTS_OBJS) $(LIBSKIA) -o out/tests/tests $(LINKER_OPTS)
-
-##############################################################################
-
-SKIMAGE_SRCS := skimage_main.cpp
-
-SKIMAGE_SRCS := $(addprefix tools/, $(SKIMAGE_SRCS))
-
-SKIMAGE_OBJS := $(SKIMAGE_SRCS:.cpp=.o)
-SKIMAGE_OBJS := $(addprefix out/, $(SKIMAGE_OBJS))
-
-skimage: $(SKIMAGE_OBJS) $(LIBSKIA)
- @echo "linking skimage..."
- $(HIDE)$(GPP) $(SKIMAGE_OBJS) $(LIBSKIA) -o out/tools/skimage $(LINKER_OPTS)
-
-##############################################################################
-
-SKDIFF_SRCS := skdiff_main.cpp
-SKDIFF_SRCS := $(addprefix tools/, $(SKDIFF_SRCS))
-SKDIFF_OBJS := $(SKDIFF_SRCS:.cpp=.o)
-SKDIFF_OBJS := $(addprefix out/, $(SKDIFF_OBJS))
-skdiff: $(SKDIFF_OBJS) out/libskia.a
- @echo "linking skdiff..."
- $(HIDE)$(GPP) $(SKDIFF_OBJS) out/libskia.a -o out/tools/skdiff $(LINKER_OPTS)
-
-##############################################################################
-
-SKHELLO_SRCS := skhello.cpp
-
-SKHELLO_SRCS := $(addprefix tools/, $(SKHELLO_SRCS))
-
-SKHELLO_OBJS := $(SKHELLO_SRCS:.cpp=.o)
-SKHELLO_OBJS := $(addprefix out/, $(SKHELLO_OBJS))
-
-skhello: $(SKHELLO_OBJS) $(LIBSKIA)
- @echo "linking shkello..."
- $(HIDE)$(GPP) $(SKHELLO_OBJS) $(LIBSKIA) -o out/tools/skhello $(LINKER_OPTS)
-
-##############################################################################
-
-include gm/gm_files.mk
-GM_SRCS := $(addprefix gm/, $(SOURCE))
-
-ifneq ($(SKIA_BUILD_FOR),mac)
- GM_SRCS += src/images/SkImageDecoder_libpng.cpp
+ifneq (,$(findstring CYGWIN, $(uname)))
+ $(error Cannot build using Make on Windows. See http://code.google.com/p/skia/wiki/GettingStartedOnWindows)
endif
-GM_OBJS := $(GM_SRCS:.cpp=.o)
-GM_OBJS := $(addprefix out/, $(GM_OBJS))
-
-gm: $(GM_OBJS) $(LIBSKIA)
- @echo "linking gm..."
- $(HIDE)$(GPP) $(GM_OBJS) $(LIBSKIA) -o out/gm/gm $(LINKER_OPTS)
-
-##############################################################################
-
-.PHONY: all
-all: $ bench gm skimage tests skhello skdiff
+# Default target. This must be listed before all other targets.
+.PHONY: default
+default: all
.PHONY: clean
clean:
- $(HIDE)rm -rf out
-
-.PHONY: help
-help:
- @echo "Targets:"
- @echo " <default>: out/libskia.a"
- @echo " bench: out/bench/bench"
- @echo " gm: out/gm/gm"
- @echo " skimage: out/tools/skimage"
- @echo " skhello: out/tools/skhello"
- @echo " tests: out/tests/tests"
- @echo " clean: removes entire out/ directory"
- @echo " help: this text"
- @echo "Options: (after make, or in bash shell)"
- @echo " SKIA_DEBUG=true for debug build"
- @echo " SKIA_SHARED=true for shared-object libskia build"
- @echo " SKIA_SCALAR=fixed for fixed-point build"
- @echo " SKIA_BUILD_FOR=mac for mac build (e.g. CG for image decoding)"
- @echo " SKIA_PDF_SUPPORT=false to disable the pdf generation backend"
- @echo ""
+ rm -rf $(outdir)
+
+# Any target OTHER than clean...
+# Ask gyp to create the real Makefile, and then pass control to it.
+%:
+ ./gyp_skia -f make
+ make -C $(outdir) $@
+
+# Unfortunately, this is a bit ugly, but necessary.
+# If there are any files/directories within the same directory as this Makefile
+# which share the same name as a target ("tests", for example), then make
+# will refuse to rebuild those targets because the file already exists.
+local_filenames := $(shell ls)
+.PHONY: $(local_filenames)
+$(local_filenames)::
+ ./gyp_skia -f make
+ make -C $(outdir) $@
--- /dev/null
+# Simple makefile for skia library and test apps
+#
+# This is the handmade Makefile that we *used* to use before changing over
+# to gyp. Keeping it around for now in case some folks need to use it...
+# but please contact epoger@google.com about anything you're still using in
+# here, so we can provide equivalent functionality in the gyp build.
+
+# setup our defaults
+CC := gcc
+GPP := g++
+C_INCLUDES := -Iinclude/config -Iinclude/core -Iinclude/effects -Iinclude/images -Iinclude/ports
+C_INCLUDES += -Iinclude/gpu -Iinclude/utils -Igpu/include
+C_INCLUDES += -Ithird_party/glu
+
+CFLAGS := -Wall -fstrict-aliasing
+#CFLAGS += -W -Wextra -Wcast-align -Wchar-subscripts -Wformat -Wformat-security -Wno-format-y2k -Wno-parentheses -Wno-unused-parameter -Wpointer-arith -Wreturn-type -Wundef -Wwrite-strings
+CFLAGS_SSE2 = $(CFLAGS) -msse2
+LINKER_OPTS := -lpthread -lz
+DEFINES := -DSK_CAN_USE_FLOAT
+HIDE = @
+
+ifeq ($(SKIA_SCALAR),fixed)
+ DEFINES += -DSK_SCALAR_IS_FIXED
+else
+ DEFINES += -DSK_SCALAR_IS_FLOAT
+endif
+
+ifeq ($(SKIA_DEBUG),true)
+ DEFINES += -DSK_DEBUG -DSK_SUPPORT_UNIT -DGR_DEBUG=1
+ CFLAGS += -g
+else
+ CFLAGS += -O3
+ DEFINES += -DSK_RELEASE -DGR_DEBUG=0
+endif
+
+DEFINES += -DGR_IMPLEMENTATION=1
+
+ifneq ($(SKIA_PDF_SUPPORT),false)
+ DEFINES += -DSK_SUPPORT_PDF
+ DEFINES += -DSK_ZLIB_INCLUDE="<zlib.h>"
+endif
+
+ifeq ($(SKIA_SHARED),true)
+ CFLAGS += -fPIC
+ LIBSKIA = out/libskia.so
+else
+ LIBSKIA = out/libskia.a
+endif
+
+# start with the core (required)
+include src/core/core_files.mk
+SRC_LIST := $(addprefix src/core/, $(SOURCE))
+
+# add the opts (optimizations)
+include src/opts/opts_sse2_files.mk
+#include src/opts/opts_files.mk
+SRC_LIST += $(addprefix src/opts/, $(SOURCE))
+
+# we usually need ports
+include src/ports/ports_files.mk
+SRC_LIST += $(addprefix src/ports/, $(SOURCE))
+
+# do we want effects?
+include src/effects/effects_files.mk
+SRC_LIST += $(addprefix src/effects/, $(SOURCE))
+
+# core image files
+include src/images/images_files.mk
+SRC_LIST += $(addprefix src/images/, $(SOURCE))
+
+# core util files
+include src/utils/utils_files.mk
+SRC_LIST += $(addprefix src/utils/, $(SOURCE))
+
+# GPU files
+include gpu/src/gr_files.mk
+SRC_LIST += $(addprefix gpu/src/, $(SOURCE))
+
+# GPU support files
+include src/gpu/skgr_files.mk
+SRC_LIST += $(addprefix src/gpu/, $(SOURCE))
+
+# pdf backend files
+ifneq ($(SKIA_PDF_SUPPORT),false)
+ C_INCLUDES += -Iinclude/pdf
+ include src/pdf/pdf_files.mk
+ SRC_LIST += $(addprefix src/pdf/, $(SOURCE))
+endif
+
+# extra files we want to build to prevent bit-rot, but not link
+JUST_COMPILE_LIST := src/ports/SkFontHost_tables.cpp
+
+# conditional files based on our platform
+ifeq ($(SKIA_BUILD_FOR),mac)
+ # make it work with 10.4 for our font port
+# GPP := g++-4.0
+# SDK := /Developer/SDKs/MacOSX10.4u.sdk
+# SDK_OPTS := -isysroot $(SDK) -mmacosx-version-min=10.4
+# CC := gcc-4.0 $(SDK_OPTS)
+
+ C_INCLUDES += -I/opt/local/include
+ LINKER_OPTS += -L/opt/local/lib -framework Carbon -lpng
+ DEFINES += -DSK_BUILD_FOR_MAC -DSK_ENABLE_LIBPNG
+ ifeq ($(SKIA_MESA),true)
+ C_INCLUDES += -I/usr/X11/include
+ LINKER_OPTS += -L/usr/X11/lib -lOSMesa -lGLU
+ DEFINES += -DSK_MESA
+ else
+ LINKER_OPTS += -framework OpenGL -framework AGL
+ endif
+ C_INCLUDES += -Iinclude/utils/mac
+# SRC_LIST += src/ports/SkImageDecoder_CG.cpp
+ SRC_LIST += src/utils/mac/SkCreateCGImageRef.cpp
+ ifeq ($(SKIA_MESA),true)
+ SRC_LIST += src/utils/mesa/SkEGLContext_Mesa.cpp
+ else
+ SRC_LIST += src/utils/mac/SkEGLContext_mac.cpp
+ endif
+ SRC_LIST += src/core/SkTypefaceCache.cpp
+ SRC_LIST += src/ports/SkFontHost_mac_coretext.cpp
+
+ # these are our registry-based factories
+ SRC_LIST += src/images/SkImageDecoder_Factory.cpp
+ SRC_LIST += src/images/SkImageEncoder_Factory.cpp
+ SRC_LIST += src/images/SkImageDecoder_libpng.cpp
+ # support files
+ SRC_LIST += src/images/SkScaledBitmapSampler.cpp
+
+ ifeq ($(SKIA_MESA),true)
+ SRC_LIST += gpu/src/mesa/GrGLDefaultInterface_mesa.cpp
+ else
+ SRC_LIST += gpu/src/mac/GrGLDefaultInterface_mac.cpp
+ endif
+
+else
+ LINKER_OPTS += -lpng -lfreetype
+ DEFINES += -DSK_BUILD_FOR_UNIX -DSK_ENABLE_LIBPNG -DGR_LINUX_BUILD=1
+ ifeq ($(SKIA_MESA),true)
+ LINKER_OPTS += -lOSMesa -lGLU
+ DEFINES += -DSK_MESA
+ else
+ LINKER_OPTS += -lGL -lGLU -lX11
+ endif
+
+ #Assume the color order for now.
+ DEFINES += -DSK_SAMPLES_FOR_X
+
+ # needed for freetype support
+ C_INCLUDES += -I/usr/include/freetype2
+ SRC_LIST += src/ports/SkFontHost_linux.cpp
+ SRC_LIST += src/ports/SkFontHost_gamma_none.cpp
+ SRC_LIST += src/ports/SkFontHost_FreeType.cpp
+ SRC_LIST += src/ports/SkFontHost_FreeType_Subpixel.cpp
+ ifeq ($(SKIA_MESA),true)
+ SRC_LIST += src/utils/mesa/SkEGLContext_Mesa.cpp
+ else
+ SRC_LIST += src/utils/unix/SkEGLContext_Unix.cpp
+ endif
+ # these are our registry-based factories
+ SRC_LIST += src/images/SkImageDecoder_Factory.cpp
+ SRC_LIST += src/images/SkImageEncoder_Factory.cpp
+ SRC_LIST += src/images/SkImageDecoder_libpng.cpp
+ # support files
+ SRC_LIST += src/images/SkScaledBitmapSampler.cpp
+
+ ifeq ($(SKIA_MESA),true)
+ SRC_LIST += gpu/src/mesa/GrGLDefaultInterface_mesa.cpp
+ else
+ SRC_LIST += gpu/src/unix/GrGLDefaultInterface_unix.cpp
+ endif
+endif
+
+# For these files, and these files only, compile with -msse2.
+SSE2_OBJS := out/src/opts/SkBlitRow_opts_SSE2.o \
+ out/src/opts/SkBitmapProcState_opts_SSE2.o \
+ out/src/opts/SkUtils_opts_SSE2.o
+$(SSE2_OBJS) : CFLAGS := $(CFLAGS_SSE2)
+
+out/%.o : %.cpp
+ @mkdir -p $(dir $@)
+ $(HIDE)$(CC) $(C_INCLUDES) $(CFLAGS) $(DEFINES) -c $< -o $@
+ @echo "compiling $@"
+
+%.s : %.cpp
+ @mkdir -p $(dir $@)
+ $(CC) $(C_INCLUDES) $(CFLAGS) $(DEFINES) -S -c $< -o $@
+
+# now build out objects
+OBJ_LIST := $(SRC_LIST:.cpp=.o)
+OBJ_LIST := $(addprefix out/, $(OBJ_LIST))
+
+# we want to compile these, but we don't actually link them
+JUST_COMPILE_OBJS := $(JUST_COMPILE_LIST:.cpp=.o)
+JUST_COMPILE_OBJS := $(addprefix out/, $(JUST_COMPILE_OBJS))
+
+out/libskia.a: Makefile $(OBJ_LIST) $(JUST_COMPILE_OBJS)
+ $(HIDE)$(AR) ru $@ $(OBJ_LIST)
+ $(HIDE)ranlib $@
+
+out/libskia.so: Makefile $(OBJ_LIST) $(JUST_COMPILE_OBJS)
+ $(HIDE)$(GPP) -shared -o $@ $(OBJ_LIST) $(JUST_COMPILE_OBJS) $(LINKER_OPTS)
+
+##############################################################################
+
+BENCH_SRCS := RectBench.cpp SkBenchmark.cpp benchmain.cpp BitmapBench.cpp \
+ RepeatTileBench.cpp DecodeBench.cpp FPSBench.cpp PathBench.cpp \
+ GradientBench.cpp MatrixBench.cpp ScalarBench.cpp
+
+BENCH_SRCS := $(addprefix bench/, $(BENCH_SRCS))
+
+# add any optional codecs for this app
+ifeq ($(SKIA_BUILD_FOR),mac)
+ BENCH_SRCS += bench/TextBench.cpp
+else
+ BENCH_SRCS += src/images/SkImageDecoder_libpng.cpp
+endif
+
+BENCH_OBJS := $(BENCH_SRCS:.cpp=.o)
+BENCH_OBJS := $(addprefix out/, $(BENCH_OBJS))
+
+bench: $(BENCH_OBJS) $(LIBSKIA)
+ @echo "linking bench..."
+ $(HIDE)$(GPP) $(BENCH_OBJS) $(LIBSKIA) -o out/bench/bench $(LINKER_OPTS)
+
+##############################################################################
+
+# we let tests cheat and see private headers, so we can unittest modules
+C_INCLUDES += -Isrc/core
+
+include tests/tests_files.mk
+ifneq ($(SKIA_PDF_SUPPORT),false)
+ SOURCE += PDFPrimitivesTest.cpp
+endif
+TESTS_SRCS := $(addprefix tests/, $(SOURCE))
+
+TESTS_OBJS := $(TESTS_SRCS:.cpp=.o)
+TESTS_OBJS := $(addprefix out/, $(TESTS_OBJS))
+
+tests: $(TESTS_OBJS) $(LIBSKIA)
+ @echo "linking tests..."
+ $(HIDE)$(GPP) $(TESTS_OBJS) $(LIBSKIA) -o out/tests/tests $(LINKER_OPTS)
+
+##############################################################################
+
+SKIMAGE_SRCS := skimage_main.cpp
+
+SKIMAGE_SRCS := $(addprefix tools/, $(SKIMAGE_SRCS))
+
+SKIMAGE_OBJS := $(SKIMAGE_SRCS:.cpp=.o)
+SKIMAGE_OBJS := $(addprefix out/, $(SKIMAGE_OBJS))
+
+skimage: $(SKIMAGE_OBJS) $(LIBSKIA)
+ @echo "linking skimage..."
+ $(HIDE)$(GPP) $(SKIMAGE_OBJS) $(LIBSKIA) -o out/tools/skimage $(LINKER_OPTS)
+
+##############################################################################
+
+SKDIFF_SRCS := skdiff_main.cpp
+SKDIFF_SRCS := $(addprefix tools/, $(SKDIFF_SRCS))
+SKDIFF_OBJS := $(SKDIFF_SRCS:.cpp=.o)
+SKDIFF_OBJS := $(addprefix out/, $(SKDIFF_OBJS))
+skdiff: $(SKDIFF_OBJS) out/libskia.a
+ @echo "linking skdiff..."
+ $(HIDE)$(GPP) $(SKDIFF_OBJS) out/libskia.a -o out/tools/skdiff $(LINKER_OPTS)
+
+##############################################################################
+
+SKHELLO_SRCS := skhello.cpp
+
+SKHELLO_SRCS := $(addprefix tools/, $(SKHELLO_SRCS))
+
+SKHELLO_OBJS := $(SKHELLO_SRCS:.cpp=.o)
+SKHELLO_OBJS := $(addprefix out/, $(SKHELLO_OBJS))
+
+skhello: $(SKHELLO_OBJS) $(LIBSKIA)
+ @echo "linking shkello..."
+ $(HIDE)$(GPP) $(SKHELLO_OBJS) $(LIBSKIA) -o out/tools/skhello $(LINKER_OPTS)
+
+##############################################################################
+
+include gm/gm_files.mk
+GM_SRCS := $(addprefix gm/, $(SOURCE))
+
+ifneq ($(SKIA_BUILD_FOR),mac)
+ GM_SRCS += src/images/SkImageDecoder_libpng.cpp
+endif
+
+GM_OBJS := $(GM_SRCS:.cpp=.o)
+GM_OBJS := $(addprefix out/, $(GM_OBJS))
+
+gm: $(GM_OBJS) $(LIBSKIA)
+ @echo "linking gm..."
+ $(HIDE)$(GPP) $(GM_OBJS) $(LIBSKIA) -o out/gm/gm $(LINKER_OPTS)
+
+##############################################################################
+
+.PHONY: all
+all: $ bench gm skimage tests skhello skdiff
+
+.PHONY: clean
+clean:
+ $(HIDE)rm -rf out
+
+.PHONY: help
+help:
+ @echo "Targets:"
+ @echo " <default>: out/libskia.a"
+ @echo " bench: out/bench/bench"
+ @echo " gm: out/gm/gm"
+ @echo " skimage: out/tools/skimage"
+ @echo " skhello: out/tools/skhello"
+ @echo " tests: out/tests/tests"
+ @echo " clean: removes entire out/ directory"
+ @echo " help: this text"
+ @echo "Options: (after make, or in bash shell)"
+ @echo " SKIA_DEBUG=true for debug build"
+ @echo " SKIA_SHARED=true for shared-object libskia build"
+ @echo " SKIA_SCALAR=fixed for fixed-point build"
+ @echo " SKIA_BUILD_FOR=mac for mac build (e.g. CG for image decoding)"
+ @echo " SKIA_PDF_SUPPORT=false to disable the pdf generation backend"
+ @echo ""
#
# Building on other platforms not tested yet.
#
+
+#
+#
+#
+#
+#
+# THIS IS DEPRECATED IN FAVOR OF trunk/skia.gyp !!!
+# Questions? Contact epoger@google.com
+#
+#
+#
+#
+
{
'targets': [
{
# This script is a wrapper which invokes gyp with the correct --depth argument,
# and supports the automatic regeneration of build files if all.gyp is
# changed (Linux-only).
+#
+
+#
+#
+#
+#
+#
+# THIS IS DEPRECATED IN FAVOR OF trunk/gyp_skia !!!
+# Questions? Contact epoger@google.com
+#
+#
+#
+#
import glob
import os
--- /dev/null
+#!/usr/bin/python
+#
+# Copyright (C) 2011 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This script is a wrapper which invokes gyp with the correct --depth argument,
+# and supports the automatic regeneration of build files if all.gyp is
+# changed (Linux-only).
+
+import glob
+import os
+import shlex
+import sys
+
+script_dir = os.path.dirname(__file__)
+
+# Directory within which we can find the gyp source.
+gyp_source_dir = os.path.join(script_dir, 'third_party', 'externals', 'gyp')
+
+# Directory within which we can find most of Skia's gyp configuration files.
+gyp_config_dir = os.path.join(script_dir, 'gyp')
+
+# Directory within which we want all generated files (including Makefiles)
+# to be written.
+output_dir = os.path.join(os.path.abspath(script_dir), 'out')
+
+sys.path.append(os.path.join(gyp_source_dir, 'pylib'))
+import gyp
+
+def additional_include_files(args=[]):
+ # Determine the include files specified on the command line.
+ # This doesn't cover all the different option formats you can use,
+ # but it's mainly intended to avoid duplicating flags on the automatic
+ # makefile regeneration which only uses this format.
+ specified_includes = set()
+ for arg in args:
+ if arg.startswith('-I') and len(arg) > 2:
+ specified_includes.add(os.path.realpath(arg[2:]))
+
+ result = []
+ def AddInclude(path):
+ if os.path.realpath(path) not in specified_includes:
+ result.append(path)
+
+ # Always include common.gypi
+ AddInclude(os.path.join(gyp_config_dir, 'common.gypi'))
+
+ return result
+
+if __name__ == '__main__':
+ args = sys.argv[1:]
+
+ # This could give false positives since it doesn't actually do real option
+ # parsing. Oh well.
+ gyp_file_specified = False
+ for arg in args:
+ if arg.endswith('.gyp'):
+ gyp_file_specified = True
+ break
+
+ # If we didn't get a file, then fall back to assuming 'skia.gyp' from the
+ # same directory as the script.
+ if not gyp_file_specified:
+ args.append(os.path.join(script_dir, 'skia.gyp'))
+
+ args.extend(['-I' + i for i in additional_include_files(args)])
+ args.extend(['--depth', '.'])
+
+ # Tell gyp to write the Makefiles into output_dir
+ args.extend(['--generator-output', os.path.abspath(output_dir)])
+
+ # Tell make to write its output into the same dir
+ args.extend(['-Goutput_dir=.'])
+
+ print 'Updating projects from gyp files...'
+ sys.stdout.flush()
+
+ # Off we go...
+ sys.exit(gyp.main(args))
--- /dev/null
+# Top-level gyp configuration for Skia.
+#
+# Projects that use Skia should depend on one or more of the targets
+# defined here.
+#
+# More targets are defined within the gyp/ directory, but those are
+# not intended for external use and may change without notice.
+#
+# Full documentation at http://code.google.com/p/skia/wiki/DocRoot
+#
+{
+ 'targets': [
+ {
+ # Use this target to build everything provided by Skia.
+ 'target_name': 'all',
+ 'type': 'none',
+ 'dependencies': [
+ 'gyp/bench.gyp:bench',
+ 'gyp/gm.gyp:gm',
+ 'gyp/SampleApp.gyp:SampleApp',
+ 'gyp/tests.gyp:tests',
+ 'gyp/tools.gyp:tools',
+ ],
+ },
+ ],
+}
+
+# Local Variables:
+# tab-width:2
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=2 shiftwidth=2: