aseprite/makefile.vc
2010-06-24 20:49:24 -03:00

249 lines
5.1 KiB
Makefile

# Copyright (C) 2001-2010 by David Capello -*-Makefile-*-
ifndef CONFIGURED
include makefile.cfg
endif
.PHONY = cfgtest
ifndef CONFIGURED
cfgtest:
@echo You must configure ASE: edit \"makefile.cfg\" or run \"fix.sh\" script
endif
######################################################################
# MSVC specific
CC = cl
RC = rc
OBJ = .obj
EXE = .exe
LIB_EXT = .lib
OBJ_DIR = obj/msvc
include makefile.lst
CFLAGS = -nologo \
-I. -Isrc -Ithird_party -W3 -Gd -EHa \
-I$(LIBFREETYPE_DIR)/include \
-I$(LIBJPEG_DIR) \
-I$(LIBPNG_DIR) \
-I$(ZLIB_DIR) \
-I$(LOADPNG_DIR) \
-I$(TINYXML_DIR) \
-I$(VACA_DIR)/include \
-DPNG_NO_MMX_CODE \
-DVACA_ALLEGRO
LFLAGS = -NOLOGO -SUBSYSTEM:WINDOWS -MACHINE:X86
LIBS = User32.lib Shell32.lib ComCtl32.lib ComDlg32.lib Gdi32.lib \
Msimg32.lib WinMM.lib AdvAPI32.lib Ole32.lib ShLwApi.lib Vfw32.Lib \
wininet.lib
ifdef DEBUGMODE
ifdef STATIC_ALLEG_LINK
CFLAGS += -Zi -MTd -DDEBUGMODE -DALLEGRO_STATICLINK
LFLAGS += -DEBUG
LIBS += alleg-debug.lib psapi.lib
else
CFLAGS += -Zi -MDd -DDEBUGMODE
LFLAGS += -DEBUG
LIBS += alleg44-debug.lib psapi.lib
endif
else
ifdef RELEASE
# Release with debug info
CFLAGS += -Zi -O2 -DNDEBUG
LFLAGS += -RELEASE
ifdef STATIC_ALLEG_LINK
CFLAGS += -MT -DALLEGRO_STATICLINK
LIBS += alleg.lib
else
CFLAGS += -MD
LIBS += alleg44.lib
endif
else
# Release with debug info
CFLAGS += -Zi -O2 -MD -DNDEBUG
LFLAGS += -DEBUG
LIBS += alleg44.lib psapi.lib
endif
endif
# Using static version of Allegro? Include DirectX libs
ifdef STATIC_ALLEG_LINK
LIBS += dinput8.lib ddraw.lib dxguid.lib dsound.lib
endif
ifdef MEMLEAK
CFLAGS += -DMEMLEAK
LIBS += dbghelp.lib
endif
ifdef HAVE_RESIZE_PATCH
CFLAGS += -DHAVE_RESIZE_PATCH
endif
######################################################################
# General rules
.PHONY = default all clean distclean
default: all
all: $(ASE)
clean:
-rm -f $(ALL_OBJS) $(THIRD_PARTY_LIBS) $(OBJ_DIR)/icon.res
distclean: clean
-rm -f $(ASE)
-include makefile.dep
######################################################################
# Rules to make third party libraries
$(LIBART_LIB): $(LIBART_OBJS)
-rm -f $@
lib -NOLOGO -OUT:$@ $^
$(LIBFREETYPE_LIB): $(LIBFREETYPE_OBJS)
-rm -f $@
lib -NOLOGO -OUT:$@ $^
$(LIBGD_LIB): $(LIBGD_OBJS)
-rm -f $@
lib -NOLOGO -OUT:$@ $^
$(LIBJPEG_LIB): $(LIBJPEG_OBJS)
-rm -f $@
lib -NOLOGO -OUT:$@ $^
$(LIBPNG_LIB): $(LIBPNG_OBJS)
-rm -f $@
lib -NOLOGO -OUT:$@ $^
$(ZLIB_LIB): $(ZLIB_OBJS)
-rm -f $@
lib -NOLOGO -OUT:$@ $^
$(LOADPNG_LIB): $(LOADPNG_OBJS)
-rm -f $@
lib -NOLOGO -OUT:$@ $^
$(TINYXML_LIB): $(TINYXML_OBJS)
-rm -f $@
lib -NOLOGO -OUT:$@ $^
$(VACA_LIB): $(VACA_OBJS)
-rm -f $@
lib -NOLOGO -OUT:$@ $^
######################################################################
# 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
$(CC) $(CFLAGS) -Fo$@ -c $<
$(OBJ_DIR)/art.%$(OBJ): %.c
$(CC) $(CFLAGS) -Fo$@ -c $<
$(OBJ_DIR)/freetype.%$(OBJ): %.c
$(CC) $(CFLAGS) -Fo$@ -c $<
$(OBJ_DIR)/gd.%$(OBJ): %.c
$(CC) $(CFLAGS) -DNONDLL -DHAVE_CONFIG_H -Fo$(OBJ_DIR) -c $<
$(OBJ_DIR)/jpeg.%$(OBJ): %.c
$(CC) $(CFLAGS) -Fo$@ -c $<
$(OBJ_DIR)/png.%$(OBJ): %.c
$(CC) $(CFLAGS) -I$(LIBPNG_DIR) -Fo$@ -c $<
$(OBJ_DIR)/zlib.%$(OBJ): %.c
$(CC) $(CFLAGS) -Fo$@ -c $<
$(OBJ_DIR)/loadpng.%$(OBJ): %.c
$(CC) $(CFLAGS) -Fo$@ -c $<
$(OBJ_DIR)/tinyxml.%$(OBJ): %.cpp
$(CC) $(CFLAGS) -Fo$@ -c $<
$(OBJ_DIR)/vaca.%$(OBJ): %.cpp
$(CC) $(CFLAGS) -Fo$@ -c $<
######################################################################
# Application
$(OBJ_DIR)/icon.res: src/icon.rc
$(RC) $<
mv src/icon.res $@
ifdef STATIC_ALLEG_LINK
$(ASE): $(ASE_DEPS) $(OBJ_DIR)/icon.res
link $(LFLAGS) $^ $(LIBS) -OUT:$@
else
$(ASE): $(ASE_DEPS) $(OBJ_DIR)/icon.res
link $(LFLAGS) $^ $(LIBS) -OUT:$@
mt -nologo -manifest $@.manifest -outputresource:$@;#2
rm $@.manifest
endif