aseprite/makefile.gcc

188 lines
4.0 KiB
Plaintext
Raw Normal View History

# Copyright (C) 2001-2009 by David Capello -*-Makefile-*-
2007-09-18 23:57:02 +00:00
.PHONY = _default
_default: default
######################################################################
# Setup CFLAGS and LFLAGS for GCC
CFLAGS += -Wall -I. -Isrc -Ithird_party \
-I$(LIBFREETYPE_DIR)/include \
-I$(LIBJPEG_DIR) \
-I$(LIBPNG_DIR) \
-I$(ZLIB_DIR) \
-Wno-deprecated-declarations \
-DPNG_NO_MMX_CODE
2007-09-18 23:57:02 +00:00
LFLAGS += $(THIRD_PARTY_LIBS)
2007-09-18 23:57:02 +00:00
ifdef PROFILE
CFLAGS += -pg
LFLAGS += -pg
else
ifdef DEBUGMODE
CFLAGS += -g3 -DDEBUGMODE
LFLAGS += -g3
2007-09-18 23:57:02 +00:00
else
CFLAGS += -s -O3 -DNDEBUG
LFLAGS += -s -O3 -DNDEBUG
2007-09-18 23:57:02 +00:00
endif
endif
ifdef MEMLEAK
CFLAGS += -DMEMLEAK
endif
2007-09-18 23:57:02 +00:00
ifdef DEFAULT_PREFIX
CFLAGS += -DDEFAULT_PREFIX="\"$(DEFAULT_PREFIX)\""
endif
ifdef USE_386_ASM
CFLAGS += -DUSE_386_ASM
endif
ifdef USE_MMX_ASM
CFLAGS += -DUSE_MMX_ASM -mmmx
endif
ifdef USE_SSE_ASM
CFLAGS += -DUSE_SSE_ASM -msse
endif
2007-09-18 23:57:02 +00:00
######################################################################
# Rules to make third party libraries
$(LIBART_LIB): $(LIBART_OBJS)
-rm -f $@
ar rs $@ $^
$(LIBFREETYPE_LIB): $(LIBFREETYPE_OBJS)
-rm -f $@
ar rs $@ $^
$(LIBGD_LIB): $(LIBGD_OBJS)
2007-09-18 23:57:02 +00:00
-rm -f $@
ar rs $@ $^
$(LIBJPEG_LIB): $(LIBJPEG_OBJS)
-rm -f $@
ar rs $@ $^
$(LIBPNG_LIB): $(LIBPNG_OBJS)
-rm -f $@
ar rs $@ $^
$(ZLIB_LIB): $(ZLIB_OBJS)
-rm -f $@
ar rs $@ $^
2007-09-18 23:57:02 +00:00
######################################################################
# Rules to build objects and the application
VPATH = src \
2007-09-23 20:13:58 +00:00
src/commands \
2007-11-08 00:54:31 +00:00
src/commands/fx \
2007-09-18 23:57:02 +00:00
src/console \
src/core \
src/dialogs \
src/effect \
src/file \
src/file/fli \
2007-09-18 23:57:02 +00:00
src/file/gif \
src/intl \
src/jinete \
src/jinete/themes \
2007-09-18 23:57:02 +00:00
src/modules \
src/raster \
src/raster/x86 \
2007-09-18 23:57:02 +00:00
src/util \
src/widgets \
src/widgets/editor \
$(LIBART_DIR) \
$(LIBFREETYPE_DIR)/src/base \
$(LIBFREETYPE_DIR)/src/autohint \
$(LIBFREETYPE_DIR)/src/cache \
$(LIBFREETYPE_DIR)/src/cff \
$(LIBFREETYPE_DIR)/src/cid \
$(LIBFREETYPE_DIR)/src/pcf \
$(LIBFREETYPE_DIR)/src/psaux \
$(LIBFREETYPE_DIR)/src/pshinter \
$(LIBFREETYPE_DIR)/src/psnames \
$(LIBFREETYPE_DIR)/src/raster \
$(LIBFREETYPE_DIR)/src/sfnt \
$(LIBFREETYPE_DIR)/src/smooth \
$(LIBFREETYPE_DIR)/src/truetype \
$(LIBFREETYPE_DIR)/src/type1 \
$(LIBFREETYPE_DIR)/src/winfonts \
$(LIBGD_DIR) \
$(LIBJPEG_DIR) \
$(LIBPNG_DIR) \
$(ZLIB_DIR)
2007-09-18 23:57:02 +00:00
2008-02-11 01:56:20 +00:00
ASE_DEPS = $(ASE_OBJS) $(THIRD_PARTY_LIBS)
2007-09-18 23:57:02 +00:00
2007-12-05 03:29:17 +00:00
######################################################################
# Rules to build the object files
2008-09-30 21:01:54 +00:00
$(OBJ_DIR)/%$(OBJ): %.cpp
$(CPP) $(CFLAGS) -o $@ -c $<
$(OBJ_DIR)/%$(OBJ): %.s
$(CC) $(CFLAGS) -x assembler-with-cpp -o $@ -c $<
$(OBJ_DIR)/art.%$(OBJ): %.c
$(CC) $(CFLAGS) -o $@ -c $<
$(OBJ_DIR)/freetype.%$(OBJ): %.c
$(CC) $(CFLAGS) -o $@ -c $<
$(OBJ_DIR)/gd.%$(OBJ): %.c
$(CC) $(CFLAGS) -DNONDLL -DHAVE_CONFIG_H -o $@ -c $<
$(OBJ_DIR)/jpeg.%$(OBJ): %.c
$(CC) $(CFLAGS) -o $@ -c $<
$(OBJ_DIR)/png.%$(OBJ): %.c
$(CC) $(CFLAGS) -I$(LIBPNG_DIR) -o $@ -c $<
$(OBJ_DIR)/zlib.%$(OBJ): %.c
$(CC) $(CFLAGS) -o $@ -c $<
2007-12-05 03:29:17 +00:00
######################################################################
# Application
2007-09-18 23:57:02 +00:00
ifndef WITHICON
$(ASE): $(ASE_DEPS)
2008-09-30 21:01:54 +00:00
$(CPP) -o $@ $(ASE_OBJS) $(LFLAGS) $(LFLAGS_LAST)
2007-09-18 23:57:02 +00:00
else
$(OBJ_DIR)/%.res: src/%.rc
$(WINDRES) -O coff -o $@ -i $<
$(ASE): $(ASE_DEPS) $(OBJ_DIR)/icon.res
2008-09-30 21:01:54 +00:00
$(CPP) -o $@ $(ASE_OBJS) $(OBJ_DIR)/icon.res $(LFLAGS) $(LFLAGS_LAST)
2007-09-18 23:57:02 +00:00
endif
2007-12-05 03:29:17 +00:00
######################################################################
# Rules to make tests
src/tests/%$(EXE): src/tests/%.cpp $(COMMON_OBJS)
2008-09-30 21:01:54 +00:00
$(CPP) $(CFLAGS) -o $@ $^ $(LFLAGS) $(LFLAGS_LAST)
src/tests/raster/%$(EXE): src/tests/raster/%.cpp $(COMMON_OBJS)
2008-09-30 21:01:54 +00:00
$(CPP) $(CFLAGS) -o $@ $^ $(LFLAGS) $(LFLAGS_LAST)
2007-12-05 03:29:17 +00:00
src/tests/jinete/%$(EXE): src/tests/jinete/%.cpp $(COMMON_OBJS)
2008-09-30 21:01:54 +00:00
$(CPP) $(CFLAGS) -o $@ $^ $(LFLAGS) $(LFLAGS_LAST)
2007-12-05 03:29:17 +00:00
tests: $(TESTS)
runtests: $(AUTOTESTS)
@-$(foreach TEST, $(AUTOTESTS), \
2008-10-02 02:31:07 +00:00
echo Running ./$(TEST) ... ; \
if ./$(TEST) ; then \
echo " - OK" ; \
else \
echo " - *FAIL*" ; \
fi ; \
)