Difference between revisions of "Win32"
From uGFX Wiki
(→Example) |
|||
| Line 5: | Line 5: | ||
== Example == | == 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. | + | 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. Modify the highlighted line(s). |
| − | <syntaxhighlight lang=make line start="1", highlight="2"> | + | <syntaxhighlight lang=make line start="1", highlight="2,27"> |
# Compiler, optimizer and uGFX library location | # Compiler, optimizer and uGFX library location | ||
GFXLIB = path/to/your/ugfx | GFXLIB = path/to/your/ugfx | ||
Revision as of 15:20, 1 July 2014
µ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:
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. Modify the highlighted line(s).
# Compiler, optimizer and uGFX library locationGFXLIB = 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 directoriesUINCDIR =ULIBDIR =# Your project definitions and librariesUDEFS =ULIBS =# Your project executablePROJECT = uGFX.exe
# Your project C source filesSRC =# Your project uGFX driversinclude $(GFXLIB)/boards/base/Win32/board.mk
include $(GFXLIB)/demos/modules/gwin/widgets/demo.mk
# ******* End: Your Project Settings **************# The default directories, libraries and sourceinclude $(GFXLIB)/gfx.mk
DSRC = $(GFXSRC) $(MYCSRC)
DINCDIR = $(GFXINC) $(MYFILES)
DLIBDIR =DLIBS = ws2_32 gdi32DDEFS =# Putting it all together - Object files and compiler flagsOBJS = $(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 rulesall: $(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)