add crude Makefile (someone please help!)

make SkFloatBits.cpp compile w/o floats



git-svn-id: http://skia.googlecode.com/svn/trunk@69 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@android.com 2009-01-16 16:15:37 +00:00
parent fc25abdabf
commit 4cb8bd18d9
6 changed files with 165 additions and 1 deletions

47
Makefile Normal file
View File

@ -0,0 +1,47 @@
CC = gcc
C_INCLUDES := -Iinclude/core -Iinclude/effects -Iinclude/images -Iinclude/utils
CFLAGS = -O2
DEFINES = -DSK_BUILD_FOR_UNIX
HIDE = @
#DEFINES += -DSK_RELEASE
DEFINES += -DSK_DEBUG -DSK_SUPPORT_UNITTEST
#DEFINES += -DSK_SCALAR_IS_FIXED
# start with the core (required)
include src/core/core_files.mk
SRC_LIST := $(addprefix src/core/, $(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))
out/%.o : %.cpp
@mkdir -p $(dir $@)
$(HIDE)$(CC) $(C_INCLUDES) $(CFLAGS) $(DEFINES) -c $< -o $@
@echo "compiling $@"
# now build out objects
OBJ_LIST := $(SRC_LIST:.cpp=.o)
OBJ_LIST := $(addprefix out/, $(OBJ_LIST))
out/libskia.a: Makefile $(OBJ_LIST)
$(HIDE)$(AR) ru $@ $(OBJ_LIST)
$(HIDE)ranlib $@
BENCH_SRCS := RectBench.cpp SkBenchmark.cpp main.cpp
BENCH_SRCS := $(addprefix bench/, $(BENCH_SRCS))
BENCH_OBJS := $(BENCH_SRCS:.cpp=.o)
BENCH_OBJS := $(addprefix out/, $(BENCH_OBJS))
bench: $(BENCH_OBJS) out/libskia.a
g++ $(BENCH_OBJS) out/libskia.a -o out/bench/bench
clean:
$(HIDE)rm -rf out

View File

@ -81,8 +81,10 @@ int main (int argc, char * const argv[]) {
SkCanvas canvas(bm);
canvas.drawColor(SK_ColorWHITE);
printf("running bench %s\n", bench->getName());
bench->draw(&canvas);
#if 0
SkString str;
make_filename(bench->getName(), &str);
str.prepend(outDir);
@ -90,6 +92,7 @@ int main (int argc, char * const argv[]) {
::remove(str.c_str());
SkImageEncoder::EncodeFile(str.c_str(), bm, SkImageEncoder::kPNG_Type,
100);
#endif
}
return 0;

View File

@ -145,6 +145,8 @@ int32_t SkFloatBits_toIntCeil(int32_t packed) {
}
}
#ifdef SK_CAN_USE_FLOAT
float SkFloatBits_intToFloatNative(int x);
float SkFloatBits_intToFloatNative(int x) {
return x;
@ -203,3 +205,4 @@ float SkIntToFloatCast_NoOverflowCheck(int32_t value) {
return data.fFloat;
}
#endif

84
src/core/core_files.mk Normal file
View File

@ -0,0 +1,84 @@
SOURCE := \
Sk64.cpp \
SkAlphaRuns.cpp \
SkBitmap.cpp \
SkBitmapProcShader.cpp \
SkBitmapProcState.cpp \
SkBitmapProcState_matrixProcs.cpp \
SkBitmapSampler.cpp \
SkBitmap_scroll.cpp \
SkBlitRow_D16.cpp \
SkBlitRow_D4444.cpp \
SkBlitter.cpp \
SkBlitter_4444.cpp \
SkBlitter_A1.cpp \
SkBlitter_A8.cpp \
SkBlitter_ARGB32.cpp \
SkBlitter_RGB16.cpp \
SkBlitter_Sprite.cpp \
SkBuffer.cpp \
SkCanvas.cpp \
SkChunkAlloc.cpp \
SkColor.cpp \
SkColorFilter.cpp \
SkColorTable.cpp \
SkComposeShader.cpp \
SkCordic.cpp \
SkDebug.cpp \
SkDebug_stdio.cpp \
SkDeque.cpp \
SkDevice.cpp \
SkDither.cpp \
SkDraw.cpp \
SkEdge.cpp \
SkFilterProc.cpp \
SkFlattenable.cpp \
SkFloat.cpp \
SkFloatBits.cpp \
SkGeometry.cpp \
SkGlobals.cpp \
SkGlyphCache.cpp \
SkGraphics.cpp \
SkMMapStream.cpp \
SkMask.cpp \
SkMaskFilter.cpp \
SkMath.cpp \
SkMatrix.cpp \
SkMemory_stdlib.cpp \
SkPackBits.cpp \
SkPaint.cpp \
SkPath.cpp \
SkPathEffect.cpp \
SkPathHeap.cpp \
SkPathMeasure.cpp \
SkPicture.cpp \
SkPictureFlat.cpp \
SkPicturePlayback.cpp \
SkPictureRecord.cpp \
SkPixelRef.cpp \
SkPoint.cpp \
SkPtrRecorder.cpp \
SkRasterizer.cpp \
SkRect.cpp \
SkRefCnt.cpp \
SkRegion.cpp \
SkRegion_path.cpp \
SkScalerContext.cpp \
SkScan.cpp \
SkScan_AntiPath.cpp \
SkScan_Antihair.cpp \
SkScan_Hairline.cpp \
SkScan_Path.cpp \
SkShader.cpp \
SkSpriteBlitter_ARGB32.cpp \
SkSpriteBlitter_RGB16.cpp \
SkStream.cpp \
SkString.cpp \
SkStroke.cpp \
SkStrokerPriv.cpp \
SkTSearch.cpp \
SkTypeface.cpp \
SkUnPreMultiply.cpp \
SkUtils.cpp \
SkWriter32.cpp \
SkXfermode.cpp

View File

@ -0,0 +1,21 @@
SOURCE := \
Sk1DPathEffect.cpp \
Sk2DPathEffect.cpp \
SkTransparentShader.cpp \
SkAvoidXfermode.cpp \
SkBlurDrawLooper.cpp \
SkBlurMask.cpp \
SkBlurMaskFilter.cpp \
SkColorFilters.cpp \
SkColorMatrixFilter.cpp \
SkCornerPathEffect.cpp \
SkDashPathEffect.cpp \
SkDiscretePathEffect.cpp \
SkEmbossMask.cpp \
SkEmbossMaskFilter.cpp \
SkGradientShader.cpp \
SkKernel33MaskFilter.cpp \
SkLayerDrawLooper.cpp \
SkLayerRasterizer.cpp \
SkPaintFlagsDrawFilter.cpp \
SkPixelXorXfermode.cpp

6
src/ports/ports_files.mk Normal file
View File

@ -0,0 +1,6 @@
SOURCE := \
SkFontHost_none.cpp \
SkGlobals_global.cpp \
SkOSFile_stdio.cpp \
SkThread_pthread.cpp \
SkTime_Unix.cpp