aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitch Bradley <wmb@firmworks.com>2016-12-02 10:10:36 -1000
committerMitch Bradley <wmb@firmworks.com>2016-12-02 10:10:36 -1000
commit4a588eb7d2b3ac53c23e13730d7f193b6e4c1f14 (patch)
tree3bc9d6cea4085a3a3638741c675ed91f41196454
parent5721fdd07b842f44aa392b437979f926184825ba (diff)
downloadcforth-4a588eb7d2b3ac53c23e13730d7f193b6e4c1f14.tar.gz
win64 - Omit FTDI and OPENGL support by default
They are rarely needed and hard to compile because of dependencies.
-rw-r--r--build/host-serial-windows64/Makefile19
-rw-r--r--src/app/host-serial/extend-win32.c2
2 files changed, 20 insertions, 1 deletions
diff --git a/build/host-serial-windows64/Makefile b/build/host-serial-windows64/Makefile
index 2d99682..d781c44 100644
--- a/build/host-serial-windows64/Makefile
+++ b/build/host-serial-windows64/Makefile
@@ -1,5 +1,19 @@
# Builds a Windows Forth application with serial port tools
+# Change the below to 'y' or pass in on the command line to enable support
+
+# FTDI=y includes code to access FTDI serial chips using FTDI's low-level
+# API, which lets you do special things like manage all their GPIO pins.
+# The default FTDI=n omits that code, but without it you can still use FTDI
+# devices as serial ports, using normal (not FTDI-specific) serial port
+# access APIs.
+
+# OPENGL=y includes support for OpenGL, so you can draw 3D graphics
+# in a separate window. It's tricky to use.
+
+FTDI ?= n
+OPENGL ?= n
+
all: default
TOPDIR=../..
@@ -8,6 +22,7 @@ CC = gcc
CONFIG += -DBITS64 -m64
CONFIG += -DFLOATING -DMOREFP
+ifeq ($(FTDI),y)
# FTDI dongle support.
# libusb.h and libusb-1.0.a must be copied into this directory
# Get the libusb 1.0 Windows binary snapshot from
@@ -16,14 +31,15 @@ CONFIG += -DFLOATING -DMOREFP
# include/libusb.h
# MinGW64/static/libusb-1.0.a
-FTDI = y
INCS += -I.
LIBS += -L.
LIBS += -lusb-1.0
+endif
# GUI support - message boxes and file open dialog
LIBS += -lcomdlg32 -lcomctl32
+ifeq ($(OPENGL),y)
# OpenGL Dependencies:
# You need to copy the following into this directory:
# GLEW - From http://glew.sourceforge.net/index.html, in the
@@ -65,5 +81,6 @@ glops.h: $(TOPDIR)/src/cforth/glops.c
./makegcalls <$<
EXTRA_CLEAN += makegcalls glops.h gcalls.fth
+endif
include $(TOPDIR)/src/app/host-serial/targets.mk
diff --git a/src/app/host-serial/extend-win32.c b/src/app/host-serial/extend-win32.c
index 2e8e29a..c5966fc 100644
--- a/src/app/host-serial/extend-win32.c
+++ b/src/app/host-serial/extend-win32.c
@@ -517,6 +517,7 @@ cell ((* const ccalls[])()) = {
C(set_progress_title) //c pb-set-title { $.msg -- }
C(set_progress_range) //c pb-set-range { i.high i.low -- }
+#ifdef USE_FTDI
C(libusb_init) //c libusb_init { a.'ctx -- i.err }
C(libusb_exit) //c libusb_exit { a.ctx -- }
C(libusb_set_debug) //c libusb_set_debug { i.level a.ctx -- }
@@ -556,6 +557,7 @@ cell ((* const ccalls[])()) = {
C(libusb_control_transfer) //c libusb_control_transfer { i.timeout i.len a.data i.windex i.wvalue i.request i.reqtype a.handle -- h.nbytes }
C(libusb_bulk_transfer) //c libusb_bulk_transfer { i.timeout a.actual i.len a.data i.ep a.handle -- h.err }
C(libusb_interrupt_transfer) //c libusb_interrupt_transfer { i.timeout a.actual i.len a.data i.ep a.handle -- h.err }
+#endif
#ifdef OPENGL
C(glfwInit) //c glfwInit { -- h.okay }