Win32
From uGFX Wiki
Revision as of 15:17, 1 July 2014 by Tectu (Talk | contribs) (Created page with "µGFX can be run natively on a Windows system. This simplifies the process of developing your embedded GUI application. The following steps are our tested method of running µ...")
µGFX can be run natively on a Windows system. This simplifies the process of developing your embedded GUI application. The following steps are our tested method of running µGFX on a Windows system:
- Make sure you got MinGW (32-bit) and CyGWIN installed.
- Compile using the Makefile below.
Example
While we do all our testing using the MinGW toolchain, it should compile equally well using Microsoft Visual Studio compilers with some changes to the Makefile.
# Compiler, optimizer and uGFX library location
GFXLIB = path/to/your/ugfx
CC = mingw32-gcc
CCOPT = -g -ggdb -O0 -fomit-frame-pointer -Wall -Wextra -Wstrict-prototypes
LDOPT = -g
# ******* Start: Your Project Settings **************
# Your project directories
UINCDIR =
ULIBDIR =
# Your project definitions and libraries
UDEFS =
ULIBS =
# Your project executable
PROJECT = uGFX.exe
# Your project C source files
SRC =
# Your project uGFX drivers
include $(GFXLIB)/boards/base/Win32/board.mk
include $(GFXLIB)/demos/modules/gwin/widgets/demo.mk
# ******* End: Your Project Settings **************
# The default directories, libraries and source
include $(GFXLIB)/gfx.mk
DSRC = $(GFXSRC) $(MYCSRC)
DINCDIR = $(GFXINC) $(MYFILES)
DLIBDIR =
DLIBS = ws2_32 gdi32
DDEFS =
# Putting it all together - Object files and compiler flags
OBJS = $(DSRC:.c=.o) $(SRC:.c=.o)
LDFLAGS = $(LDOPT) $(patsubst %,-L%, $(ULIBDIR) $(DLIBDIR)) $(patsubst %,-l%, $(ULIBS) $(DLIBS))
CCFLAGS = $(CCOPT) $(patsubst %,-D%, $(UDEFS) $(DDEFS)) $(patsubst %,-I%, . $(UINCDIR) $(DINCDIR))
# Makefile rules
all: $(OBJS) $(PROJECT)
%.o : %.c
$(CC) -DGFX_USE_OS_WIN32=TRUE -c $(CCFLAGS) $< -o $@
%.exe: $(OBJS)
$(CC) $(OBJS) $(LDFLAGS) -o $@
run: $(PROJECT)
./$(PROJECT)
clean:
-rm -f $(OBJS)
-rm -f $(PROJECT)