mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-30 12:19:04 +00:00
219 lines
4.6 KiB
Makefile
219 lines
4.6 KiB
Makefile
# Copyright (C) 2001-2010 by David Capello -*-Makefile-*-
|
|
|
|
.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) \
|
|
-I$(LOADPNG_DIR) \
|
|
-I$(TINYXML_DIR) \
|
|
-I$(VACA_DIR)/include \
|
|
-Wno-deprecated-declarations \
|
|
-DPNG_NO_MMX_CODE \
|
|
-DVACA_ALLEGRO
|
|
|
|
LFLAGS += $(THIRD_PARTY_LIBS)
|
|
|
|
ifdef PROFILE
|
|
CFLAGS += -pg -O3 -DNDEBUG
|
|
LFLAGS += -pg -O3 -DNDEBUG
|
|
else
|
|
ifdef DEBUGMODE
|
|
CFLAGS += -g3 -DDEBUGMODE
|
|
LFLAGS += -g3
|
|
else
|
|
CFLAGS += -s -O3 -DNDEBUG
|
|
LFLAGS += -s -O3 -DNDEBUG
|
|
endif
|
|
endif
|
|
|
|
ifdef MEMLEAK
|
|
CFLAGS += -DMEMLEAK
|
|
endif
|
|
|
|
ifdef DEFAULT_PREFIX
|
|
CFLAGS += -DDEFAULT_PREFIX="\"$(DEFAULT_PREFIX)\""
|
|
endif
|
|
|
|
ifdef USE_MMX_ASM
|
|
CFLAGS += -mmmx
|
|
endif
|
|
|
|
ifdef USE_SSE_ASM
|
|
CFLAGS += -msse
|
|
endif
|
|
|
|
ifdef HAVE_RESIZE_PATCH
|
|
CFLAGS += -DHAVE_RESIZE_PATCH
|
|
endif
|
|
|
|
######################################################################
|
|
# 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)
|
|
-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 $@ $^
|
|
|
|
$(LOADPNG_LIB): $(LOADPNG_OBJS)
|
|
-rm -f $@
|
|
ar rs $@ $^
|
|
|
|
$(TINYXML_LIB): $(TINYXML_OBJS)
|
|
-rm -f $@
|
|
ar rs $@ $^
|
|
|
|
$(VACA_LIB): $(VACA_OBJS)
|
|
-rm -f $@
|
|
ar rs $@ $^
|
|
|
|
######################################################################
|
|
# Rules to build objects and the application
|
|
|
|
VPATH = src \
|
|
src/ase \
|
|
src/commands \
|
|
src/commands/fx \
|
|
src/console \
|
|
src/core \
|
|
src/dialogs \
|
|
src/effect \
|
|
src/file \
|
|
src/file/fli \
|
|
src/file/gif \
|
|
src/intl \
|
|
src/jinete \
|
|
src/jinete/themes \
|
|
src/modules \
|
|
src/raster \
|
|
src/raster/x86 \
|
|
src/settings \
|
|
src/tools \
|
|
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) \
|
|
$(LOADPNG_DIR) \
|
|
$(TINYXML_DIR) \
|
|
$(VACA_DIR)/src
|
|
|
|
ASE_DEPS = $(ASE_OBJS) $(THIRD_PARTY_LIBS)
|
|
|
|
######################################################################
|
|
# Rules to build the object files
|
|
|
|
$(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 $<
|
|
|
|
$(OBJ_DIR)/loadpng.%$(OBJ): %.c
|
|
$(CC) $(CFLAGS) -o $@ -c $<
|
|
|
|
$(OBJ_DIR)/tinyxml.%$(OBJ): %.cpp
|
|
$(CPP) $(CFLAGS) -o $@ -c $<
|
|
|
|
$(OBJ_DIR)/vaca.%$(OBJ): %.cpp
|
|
$(CPP) $(CFLAGS) -o $@ -c $<
|
|
|
|
######################################################################
|
|
# Application
|
|
|
|
ifndef WITHICON
|
|
$(ASE): $(ASE_DEPS)
|
|
$(CPP) -o $@ $(ASE_OBJS) $(LFLAGS) $(LFLAGS_LAST)
|
|
else
|
|
$(OBJ_DIR)/%.res: src/%.rc
|
|
$(WINDRES) -O coff -o $@ -i $<
|
|
|
|
$(ASE): $(ASE_DEPS) $(OBJ_DIR)/resources_win32.res
|
|
$(CPP) -o $@ $(ASE_OBJS) $(OBJ_DIR)/resources_win32.res $(LFLAGS) $(LFLAGS_LAST)
|
|
endif
|
|
|
|
######################################################################
|
|
# Rules to make tests
|
|
|
|
src/tests/%$(EXE): src/tests/%.cpp $(COMMON_OBJS)
|
|
$(CPP) $(CFLAGS) -o $@ $^ $(LFLAGS) $(LFLAGS_LAST)
|
|
|
|
src/tests/raster/%$(EXE): src/tests/raster/%.cpp $(COMMON_OBJS)
|
|
$(CPP) $(CFLAGS) -o $@ $^ $(LFLAGS) $(LFLAGS_LAST)
|
|
|
|
src/tests/jinete/%$(EXE): src/tests/jinete/%.cpp $(COMMON_OBJS)
|
|
$(CPP) $(CFLAGS) -o $@ $^ $(LFLAGS) $(LFLAGS_LAST)
|
|
|
|
tests: $(TESTS)
|
|
|
|
runtests: $(AUTOTESTS)
|
|
@-$(foreach TEST, $(AUTOTESTS), \
|
|
echo Running ./$(TEST) ... ; \
|
|
if ./$(TEST) ; then \
|
|
echo " - OK" ; \
|
|
else \
|
|
echo " - *FAIL*" ; \
|
|
fi ; \
|
|
)
|