summaryrefslogtreecommitdiff
path: root/windows
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2017-08-24 15:56:33 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2017-08-24 15:56:33 +0200
commitb7977b574dbbb1ba7d3e109e55ab08b7d76fb42a (patch)
tree638eb28c7f4e62dcf2f619a9cbc576811457a95d /windows
parent880c9f6def862043bed078a190d7a9e96d01aa37 (diff)
downloadlibgd-b7977b574dbbb1ba7d3e109e55ab08b7d76fb42a.tar.gz
Add support for building the programs with MSVC
We add support for building all executable programs in `src/` to the native MSVC build script, except for `webpng.exe` due to #401.
Diffstat (limited to 'windows')
-rw-r--r--windows/Makefile.vc25
-rw-r--r--windows/readme.md5
2 files changed, 27 insertions, 3 deletions
diff --git a/windows/Makefile.vc b/windows/Makefile.vc
index 73a155e..1650fab 100644
--- a/windows/Makefile.vc
+++ b/windows/Makefile.vc
@@ -99,6 +99,19 @@ LIB_OBJS= \
LIBS=kernel32.lib ole32.lib user32.lib advapi32.lib shell32.lib ws2_32.lib Dnsapi.lib Gdi32.Lib
LIBS_GD=libjpeg_a.lib freetype_a.lib libpng_a.lib libiconv_a.lib zlib_a.lib libwebp_a.lib libxpm_a.lib libtiff.lib
+PROG_EXES= \
+ $(LIBGD_OBJ_DIR)\gdcmpgif.exe \
+ $(LIBGD_OBJ_DIR)\gdtopng.exe \
+ $(LIBGD_OBJ_DIR)\pngtogd.exe \
+ $(LIBGD_OBJ_DIR)\gdparttopng.exe \
+ $(LIBGD_OBJ_DIR)\gd2topng.exe \
+ $(LIBGD_OBJ_DIR)\pngtogd2.exe \
+ $(LIBGD_OBJ_DIR)\annotate.exe \
+ $(LIBGD_OBJ_DIR)\gd2copypal.exe \
+ $(LIBGD_OBJ_DIR)\gd2togif.exe \
+ $(LIBGD_OBJ_DIR)\giftogd2.exe
+PROG_OBJS=$(PROG_EXES:exe=obj)
+
INCLUDES=/Isrc /I$(WITH_DEVEL)\include -I$(WITH_DEVEL)\include\libpng16 -I$(WITH_DEVEL)\include\freetype -I$(WITH_DEVEL)\include\freetype2 /Itests /Itests\gdtest -I$(WITH_DEVEL)\include\
LDFLAGS=/nologo /nodefaultlib:libcmt /libpath:$(WITH_DEVEL)\lib /MACHINE:$(PLATFORM)
@@ -150,7 +163,8 @@ TEST_OBJS=$(TEST_OBJS:exe=obj)
# pseudotargets
build_libs: make_dirs $(TARGETDLL) $(TARGETLIB)
-all: build_libs build_tests
+build_progs: build_libs $(PROG_OBJS) $(PROG_EXES)
+all: build_libs build_tests build_progs
check: all run_tests
clean:
@@ -219,7 +233,7 @@ $(TARGETLIB): $(LIB_OBJS)
all: $(LIBGD_OBJ_DIR) $(LIBGD_BIN_DIR) $(LIB_OBJS) $(STATICLIB)
-.SUFFIXES: .c .obj .res
+.SUFFIXES: .c .obj .res .exe
# tests
@@ -234,4 +248,9 @@ $(SDR)readdir.obj: $(TARGETDLL) tests\gdtest\readdir.c
pretest: $(TARGETDLL)
if not exist $(TDR) mkdir $(TDR)
- copy $(TARGETDLL) $(TDR)$(GD_DLL) \ No newline at end of file
+ copy $(TARGETDLL) $(TDR)$(GD_DLL)
+
+# programs
+
+{$(LIBGD_OBJ_DIR)}.obj{$(LIBGD_OBJ_DIR)}.exe:
+ $(LD) $(LDFLAGS) $** $(BUILD_DIR)\libgd.lib /out:$@
diff --git a/windows/readme.md b/windows/readme.md
index e9b8217..cd95b79 100644
--- a/windows/readme.md
+++ b/windows/readme.md
@@ -38,6 +38,11 @@ nmake /f windows\Makefile.vc
nmake /f windows\Makefile.vc check
````
+* To build the executable programs, do:
+````
+nmake /f windows\Makefile.vc build_progs
+````
+
* After a successful build, you find the libraries and test executables in
`..\gdbuild`. You can change the build folder by setting the environment
variable `WITH_BUILD` to the desired path.