Difference between revisions of "Mac OS X"
From uGFX Wiki
(Created page with "µGFX can be run natively on a Mac OS X system. This simplifies the process of developing your embedded GUI application a lot. <br/> The following steps are required to run µ...") |
|||
Line 2: | Line 2: | ||
The following steps are required to run µGFX on Mac OS X system: | The following steps are required to run µGFX on Mac OS X system: | ||
− | # Make sure you got ''clang'' installed | + | # Make sure you got '''clang''' installed |
− | # Make sure you got ''XQuartz'' installed | + | # Make sure you got '''XQuartz''' installed |
# Compile using the Makefile below | # Compile using the Makefile below | ||
Revision as of 15:15, 1 July 2014
µGFX can be run natively on a Mac OS X system. This simplifies the process of developing your embedded GUI application a lot.
The following steps are required to run µGFX on Mac OS X system:
- Make sure you got clang installed
- Make sure you got XQuartz installed
- Compile using the Makefile below
Example
The following Makefile has been tested under Mac OS X 10.8. Please let us know when you faced some problems running it under a different version.
Note: The performance of the resulting programm is very bad. This is because the X driver just uses setPixel() and doesn't take any advantage of area blitting or double buffering. The application will run A LOT faster on the actual microcontroller.
# The name of the project / binary
PROJECT = ugfx
# List C source files here
SRC = $(GFXSRC) \
main.c
# List all user directories here
UINCDIR = $(GFXINC) \
# List all libraries
LIBS = -lX11
# Include uGFX
GFXLIB = /path/to/your/ugfx
include $(GFXLIB)/gfx.mk
include $(GFXLIB)/boards/base/Linux/board.mk
###############################################################################
# Do not change anything below this line unless you know what you're doing #
###############################################################################
# Your toolchain
CC = clang
INCDIR = $(patsubst %,-I%,$(DINCDIR) $(UINCDIR)) -I/opt/X11/include
LIBDIR = $(patsubst %,-L%,$(DLIBDIR) $(ULIBDIR)) -L/opt/X11/lib
OBJS = $(SRC:.c=.o)
CCFLAGS = -O2 -Wall
LDFLAGS =
###############################################################################
# Actual Makefile rules #
###############################################################################
all: $(OBJS) $(PROJECT)
%.o : %.c
$(CC) -c $(CCFLAGS) -I . $(INCDIR) $< -o $@
$(PROJECT): $(OBJS)
$(CC) $(OBJS) $(LDFLAGS) $(LIBS) $(LIBDIR) -o $@
clean:
-rm -f $(OBJS)
-rm -f $(PROJECT)