aseprite/makefile.vc

238 lines
5.0 KiB
Plaintext
Raw Normal View History

# Copyright (C) 2001-2009 by David Capello -*-Makefile-*-
2008-09-30 16:10:12 +00:00
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 \
2008-09-30 16:10:12 +00:00
-I$(LIBFREETYPE_DIR)/include \
-I$(LIBJPEG_DIR) \
-I$(LIBPNG_DIR) \
-I$(ZLIB_DIR) \
-I$(LOADPNG_DIR) \
2009-12-11 13:10:56 +00:00
-I$(TINYXML_DIR) \
-I$(VACA_DIR)/include \
-DPNG_NO_MMX_CODE \
-DVACA_ALLEGRO
2008-09-30 16:10:12 +00:00
LFLAGS = -NOLOGO -SUBSYSTEM:WINDOWS -MACHINE:X86
2008-09-30 16:10:12 +00:00
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 ddraw.lib dxguid.lib dsound.lib dinput8.lib
2008-09-30 16:10:12 +00:00
ifdef DEBUGMODE
ifdef STATIC_ALLEG_LINK
CFLAGS += -Zi -MTd -DDEBUGMODE -DALLEGRO_STATICLINK
LFLAGS += -DEBUG
LIBS += alld_s_crt.lib psapi.lib
else
CFLAGS += -Zi -MDd -DDEBUGMODE
LFLAGS += -DEBUG
LIBS += Alld.lib psapi.lib
endif
2008-09-30 16:10:12 +00:00
else
ifdef RELEASE
CFLAGS += -O2 -DNDEBUG
LFLAGS += -RELEASE
ifdef STATIC_ALLEG_LINK
CFLAGS += -MT -DALLEGRO_STATICLINK
LIBS += Alleg_s_crt.lib
LIBS += dinput8.lib ddraw.lib dxguid.lib dsound.lib
else
CFLAGS += -MD
LIBS += Alleg.lib
endif
else
# Release with debug info
CFLAGS += -Zi -O2 -MD -DNDEBUG
LFLAGS += -DEBUG
LIBS += Alleg.lib
LIBS += psapi.lib
endif
2008-09-30 16:10:12 +00:00
endif
2009-07-12 20:29:16 +00:00
ifdef MEMLEAK
CFLAGS += -DMEMLEAK
LIBS += dbghelp.lib
endif
ifdef HAVE_RESIZE_PATCH
CFLAGS += -DHAVE_RESIZE_PATCH
endif
2008-09-30 16:10:12 +00:00
######################################################################
# 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:$@ $^
2008-09-30 16:10:12 +00:00
$(LIBFREETYPE_LIB): $(LIBFREETYPE_OBJS)
-rm -f $@
lib -NOLOGO -OUT:$@ $^
2008-09-30 16:10:12 +00:00
$(LIBGD_LIB): $(LIBGD_OBJS)
-rm -f $@
lib -NOLOGO -OUT:$@ $^
2008-09-30 16:10:12 +00:00
$(LIBJPEG_LIB): $(LIBJPEG_OBJS)
-rm -f $@
lib -NOLOGO -OUT:$@ $^
2008-09-30 16:10:12 +00:00
$(LIBPNG_LIB): $(LIBPNG_OBJS)
-rm -f $@
lib -NOLOGO -OUT:$@ $^
2008-09-30 16:10:12 +00:00
$(ZLIB_LIB): $(ZLIB_OBJS)
-rm -f $@
lib -NOLOGO -OUT:$@ $^
2008-09-30 16:10:12 +00:00
$(LOADPNG_LIB): $(LOADPNG_OBJS)
-rm -f $@
lib -NOLOGO -OUT:$@ $^
2009-12-11 13:10:56 +00:00
$(TINYXML_LIB): $(TINYXML_OBJS)
-rm -f $@
lib -NOLOGO -OUT:$@ $^
$(VACA_LIB): $(VACA_OBJS)
-rm -f $@
lib -NOLOGO -OUT:$@ $^
2008-09-30 16:10:12 +00:00
######################################################################
# Rules to build objects and the application
VPATH = src \
src/ase \
2008-09-30 16:10:12 +00:00
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 \
2008-09-30 16:10:12 +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) \
2009-12-11 13:10:56 +00:00
$(LOADPNG_DIR) \
$(TINYXML_DIR) \
$(VACA_DIR)/src
2008-09-30 16:10:12 +00:00
ASE_DEPS = $(ASE_OBJS) $(THIRD_PARTY_LIBS)
######################################################################
# Rules to build the object files
2008-09-30 21:01:54 +00:00
$(OBJ_DIR)/%$(OBJ): %.cpp
2008-09-30 16:10:12 +00:00
$(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 $<
2009-12-11 13:10:56 +00:00
$(OBJ_DIR)/tinyxml.%$(OBJ): %.cpp
$(CC) $(CFLAGS) -Fo$@ -c $<
$(OBJ_DIR)/vaca.%$(OBJ): %.cpp
$(CC) $(CFLAGS) -Fo$@ -c $<
2008-09-30 16:10:12 +00:00
######################################################################
# Application
$(OBJ_DIR)/icon.res: src/icon.rc
$(RC) $<
mv src/icon.res $@
$(ASE): $(ASE_DEPS) $(OBJ_DIR)/icon.res
link $(LFLAGS) $^ $(LIBS) -OUT:$@
# To embed the manifest file uncomment the following lines:
# mt -nologo -manifest $@.manifest -outputresource:$@;#2
# rm $@.manifest