aboutsummaryrefslogtreecommitdiffstats
path: root/boards/base
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2014-09-28 01:42:30 +1000
committerinmarket <andrewh@inmarket.com.au>2014-09-28 01:42:30 +1000
commitdaf9f65b9fb9822bc3bc80d63b66a612e085802a (patch)
tree554493727b03b8dc0277a9f7d5b53e339188a1fd /boards/base
parent2776d00e82b85365efa38d0067b658fd2818ca41 (diff)
downloaduGFX-daf9f65b9fb9822bc3bc80d63b66a612e085802a.tar.gz
uGFX-daf9f65b9fb9822bc3bc80d63b66a612e085802a.tar.bz2
uGFX-daf9f65b9fb9822bc3bc80d63b66a612e085802a.zip
New makefile structure. Also OSX board defintion
Diffstat (limited to 'boards/base')
-rw-r--r--boards/base/Linux-Framebuffer/board.mk1
-rw-r--r--boards/base/Linux-Framebuffer/example/Makefile234
-rw-r--r--boards/base/Linux/board.mk1
-rw-r--r--boards/base/Linux/example/Makefile234
-rw-r--r--boards/base/OSX/board.mk7
-rw-r--r--boards/base/OSX/example/Makefile47
-rw-r--r--boards/base/OSX/example/readme.txt5
-rw-r--r--boards/base/OSX/readme.txt7
-rw-r--r--boards/base/Win32/board.mk4
-rw-r--r--boards/base/Win32/example/Makefile264
10 files changed, 177 insertions, 627 deletions
diff --git a/boards/base/Linux-Framebuffer/board.mk b/boards/base/Linux-Framebuffer/board.mk
index 69be7ac1..a9acce0a 100644
--- a/boards/base/Linux-Framebuffer/board.mk
+++ b/boards/base/Linux-Framebuffer/board.mk
@@ -1,5 +1,6 @@
GFXINC += $(GFXLIB)/boards/base/Linux-Framebuffer
GFXSRC +=
GFXDEFS += -DGFX_USE_OS_LINUX=TRUE
+GFXLIBS += rt
include $(GFXLIB)/drivers/gdisp/framebuffer/driver.mk
diff --git a/boards/base/Linux-Framebuffer/example/Makefile b/boards/base/Linux-Framebuffer/example/Makefile
index d5032f57..29b0a266 100644
--- a/boards/base/Linux-Framebuffer/example/Makefile
+++ b/boards/base/Linux-Framebuffer/example/Makefile
@@ -1,220 +1,44 @@
-#
-# !!!! Do NOT edit this makefile with an editor which replace tabs by spaces !!!!
-#
-##############################################################################################
-#
-# On command line:
-#
-# make all = Create project
-#
-# make clean = Clean project files.
-#
-# To rebuild project do "make clean" and "make all".
-#
-
-##############################################################################################
-# Start of make control
-#
-
-# Verbose compiling?
-USE_VERBOSE_COMPILE=no
-
-# Generate listing files?
-USE_LISTING=no
-
-# Your project name and executable file name - Optional, defaults to the project directory name
-#PROJECT=uGFX
+# Possible Targets: all clean Debug cleanDebug Release cleanRelease
##############################################################################################
-# Start of default section
+# Settings
#
-TRGT =
-CC = $(TRGT)gcc
-AS = $(TRGT)gcc -x assembler-with-cpp
-
-# List all default C defines here, like -D_DEBUG=1
-DDEFS =
-
-# List all default ASM defines here, like -D_DEBUG=1
-DADEFS =
-
-# List all default directories to look for include files here
-DINCDIR =
+# See $(GFXLIB)/tools/gmake_scripts/readme.txt for the meaning of these variables
+OPT_VERBOSE_COMPILE = no
+OPT_GENERATE_LISTINGS = yes
+OPT_GENERATE_MAP = yes
+OPT_COPY_EXE = no
+OPT_NATIVEOS = linux
+OPT_OS = linux
-# List the default directory to look for the libraries here
-DLIBDIR =
+# See $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk for the meaning of these variables
+GFXLIB = ../uGFX
+GFXBOARD = Linux-Framebuffer
+#GFXDRIVERS = multiple/uGFXnet
+GFXDEMO = modules/gdisp/basics
-# List all default libraries here
-DLIBS = -lrt
-
-#
-# End of default section
##############################################################################################
-
-##############################################################################################
-# Start of user section
+# Set these for your project
#
-# Default project name is the project directory name
-ifeq ($(PROJECT),)
- PROJECT := $(notdir $(patsubst %/,%,$(dir $(abspath $(firstword $(MAKEFILE_LIST))))))
-endif
-
-# Imported source files and paths for uGFX
-GFXLIB = ../ugfx
-include ${GFXLIB}/gfx.mk
-include ${GFXLIB}/boards/base/Linux-Framebuffer/board.mk
-
-# Where is our source code - alter these for your project.
-# Either just include the demo makefile or add your own definitions
-include $(GFXLIB)/demos/modules/gdisp/basics/demo.mk
-#MYFILES = my-project-directory
-#MYCSRC = $(MYFILES)/main.c
-#MYDEFS =
-
-# List all user C define here, like -D_DEBUG=1
-UDEFS = $(MYDEFS) $(GFXDEFS)
-
-# Define ASM defines here
-UADEFS =
-
-# List C source files here
-SRC = $(GFXSRC) \
- $(MYCSRC)
+ARCH =
+SRCFLAGS = -m32 -ggdb -O0 -fomit-frame-pointer -Wall -Wextra -Wstrict-prototypes -fverbose-asm
+CFLAGS =
+CXXFLAGS =
+ASFLAGS =
+LDFLAGS = -pthread
-# List ASM source files here
-ASRC =
+SRC =
+DEFS =
+LIBS =
+INCPATH =
+LIBPATH =
-# List all user directories here
-UINCDIR = $(MYFILES) $(GFXINC)
-
-# List the user directory to look for the libraries here
-ULIBDIR =
-
-# List all user libraries here
-ULIBS =
-
-# Define optimisation level here
-OPT = -ggdb -O0 -fomit-frame-pointer
-
-#
-# End of user defines
##############################################################################################
-
-I# Output directory and files
-ifeq ($(MAKECMDGOALS),Debug)
- BUILDDIR = bin/Debug
-else ifeq ($(MAKECMDGOALS),Release)
- BUILDDIR = bin/Release
-else ifeq ($(MAKECMDGOALS),cleanDebug)
- BUILDDIR = bin/Debug
-else ifeq ($(MAKECMDGOALS),cleanRelease)
- BUILDDIR = bin/Release
-else ifeq ($(BUILDDIR),)
- BUILDDIR = .build
-else ifeq ($(BUILDDIR),.)
- BUILDDIR = .build
-endif
-
-OBJDIR = $(BUILDDIR)/obj
-LSTDIR = $(BUILDDIR)/lst
-MAPDIR = $(BUILDDIR)/map
-DEPDIR = .dep
-
-INCDIR = $(patsubst %,-I%,$(DINCDIR) $(UINCDIR))
-LIBDIR = $(patsubst %,-L%,$(DLIBDIR) $(ULIBDIR))
-DEFS = $(DDEFS) $(UDEFS)
-ADEFS = $(DADEFS) $(UADEFS)
-COBJ = $(addprefix $(OBJDIR)/, $(subst ../,_dot_dot/,$(SRC:.c=.o)))
-AOBJ = $(addprefix $(OBJDIR)/, $(subst ../,_dot_dot/,$(ASRC:.s=.o)))
-OBJS = $(AOBJ) $(COBJ)
-LIBS = $(DLIBS) $(ULIBS)
-
-ASFLAGS = $(ADEFS)
-CPFLAGS = $(OPT) -Wall -Wextra -Wstrict-prototypes -fverbose-asm $(DEFS)
-LDFLAGS = -Wl,-Map=$(MAPDIR)/$(PROJECT).map,--cref,--no-warn-mismatch $(LIBDIR)
-ifeq ($(USE_LISTING),yes)
- ASFLAGS += -Wa,-amhls=$(LSTDIR)/$(subst ../,_dot_dot/,$(<:.s=.lst))
- CPFLAGS += -Wa,-alms=$(LSTDIR)/$(subst ../,_dot_dot/,$(<:.c=.lst))
-endif
-
-ifeq ($(HOST_OSX),yes)
- ifeq ($(OSX_SDK),)
- OSX_SDK = /Developer/SDKs/MacOSX10.7.sdk
- endif
- ifeq ($(OSX_ARCH),)
- OSX_ARCH = -mmacosx-version-min=10.3 -arch i386
- endif
-
- LIBS += $(OSX_ARCH)
- CPFLAGS += -isysroot $(OSX_SDK) $(OSX_ARCH)
- LDFLAGS = -Wl -Map=$(MAPDIR)/$(PROJECT).map,-syslibroot,$(OSX_SDK),$(LIBDIR)
-else
- # Linux, or other
- CPFLAGS += -m32
-endif
-
-# Generate dependency information
-CPFLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d
-
-#
-# makefile rules
-#
-
-Debug Release: all
-
-cleanDebug cleanRelease: clean
-
-all: $(BUILDDIR) $(OBJS) $(PROJECT)
-
-$(BUILDDIR) $(OBJDIR) $(LSTDIR) $(MAPDIR):
- mkdir -p $(OBJDIR)
- mkdir -p $(MAPDIR)
-ifeq ($(USE_LISTING),yes)
- mkdir -p $(LSTDIR)
-endif
-ifneq ($(USE_VERBOSE_COMPILE),yes)
- @echo Compiler Options - $(CC) -c $(CPFLAGS) -I. $(INCDIR) main.c -o $(OBJDIR)/main.o
- @echo
-endif
-
-.SECONDEXPANSION:
-$(OBJDIR)/%.o : $$(subst _dot_dot/,../,%.c)
- @mkdir -p $(dir $@)
-ifeq ($(USE_VERBOSE_COMPILE),yes)
- @echo
- $(CC) -c $(CPFLAGS) -I. $(INCDIR) $< -o $@
-else
- @echo Compiling $<
- @$(CC) -c $(CPFLAGS) -I. $(INCDIR) $< -o $@
-endif
-
-$(OBJDIR)/%.o : $$(subst _dot_dot/,../,%.s)
- @mkdir -p $(dir $@)
-ifeq ($(USE_VERBOSE_COMPILE),yes)
- @echo
- $(AS) -c $(ASFLAGS) -I. $(INCDIR) $< -o $@
-else
- @echo Compiling $<
- @$(AS) -c $(ASFLAGS) -I. $(INCDIR) $< -o $@
-endif
-
-$(PROJECT): $(OBJS)
- $(CC) $(OBJS) $(LDFLAGS) $(LIBS) -o $@
-
-gcov:
- -mkdir gcov
- $(COV) -u $(subst /,\,$(SRC))
- -mv *.gcov ./gcov
-
-clean:
- -rm -fR $(BUILDDIR)
- -rm -fR $(DEPDIR)
-
-#
-# Include the dependency files, should be the last of the makefile
+# These should be at the end
#
--include $(shell mkdir $(DEPDIR) 2>/dev/null) $(wildcard $(DEPDIR)/*)
+include $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk
+include $(GFXLIB)/tools/gmake_scripts/compiler_gcc.mk
# *** EOF ***
diff --git a/boards/base/Linux/board.mk b/boards/base/Linux/board.mk
index 4334c2fc..49004bdd 100644
--- a/boards/base/Linux/board.mk
+++ b/boards/base/Linux/board.mk
@@ -1,6 +1,7 @@
GFXINC += $(GFXLIB)/boards/base/Linux
GFXSRC +=
GFXDEFS += -DGFX_USE_OS_LINUX=TRUE
+GFXLIBS += rt
include $(GFXLIB)/drivers/multiple/X/driver.mk
diff --git a/boards/base/Linux/example/Makefile b/boards/base/Linux/example/Makefile
index 21343755..87b80434 100644
--- a/boards/base/Linux/example/Makefile
+++ b/boards/base/Linux/example/Makefile
@@ -1,220 +1,44 @@
-#
-# !!!! Do NOT edit this makefile with an editor which replace tabs by spaces !!!!
-#
-##############################################################################################
-#
-# On command line:
-#
-# make all = Create project
-#
-# make clean = Clean project files.
-#
-# To rebuild project do "make clean" and "make all".
-#
-
-##############################################################################################
-# Start of make control
-#
-
-# Verbose compiling?
-USE_VERBOSE_COMPILE=no
-
-# Generate listing files?
-USE_LISTING=no
-
-# Your project name and executable file name - Optional, defaults to the project directory name
-#PROJECT=uGFX
+# Possible Targets: all clean Debug cleanDebug Release cleanRelease
##############################################################################################
-# Start of default section
+# Settings
#
-TRGT =
-CC = $(TRGT)gcc
-AS = $(TRGT)gcc -x assembler-with-cpp
-
-# List all default C defines here, like -D_DEBUG=1
-DDEFS =
-
-# List all default ASM defines here, like -D_DEBUG=1
-DADEFS =
-
-# List all default directories to look for include files here
-DINCDIR =
+# See $(GFXLIB)/tools/gmake_scripts/readme.txt for the meaning of these variables
+OPT_VERBOSE_COMPILE = no
+OPT_GENERATE_LISTINGS = yes
+OPT_GENERATE_MAP = yes
+OPT_COPY_EXE = no
+OPT_NATIVEOS = linux
+OPT_OS = linux
-# List the default directory to look for the libraries here
-DLIBDIR =
+# See $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk for the meaning of these variables
+GFXLIB = ../uGFX
+GFXBOARD = Linux
+#GFXDRIVERS = multiple/uGFXnet
+GFXDEMO = modules/gdisp/basics
-# List all default libraries here
-DLIBS = -lX11 -pthread -lrt
-
-#
-# End of default section
##############################################################################################
-
-##############################################################################################
-# Start of user section
+# Set these for your project
#
-# Default project name is the project directory name
-ifeq ($(PROJECT),)
- PROJECT := $(notdir $(patsubst %/,%,$(dir $(abspath $(firstword $(MAKEFILE_LIST))))))
-endif
-
-# Imported source files and paths for uGFX
-GFXLIB = ../ugfx
-include ${GFXLIB}/gfx.mk
-include ${GFXLIB}/boards/base/Linux/board.mk
-
-# Where is our source code - alter these for your project.
-# Either just include the demo makefile or add your own definitions
-include $(GFXLIB)/demos/modules/gdisp/basics/demo.mk
-#MYFILES = my-project-directory
-#MYCSRC = $(MYFILES)/main.c
-#MYDEFS =
-
-# List all user C define here, like -D_DEBUG=1
-UDEFS = $(MYDEFS) $(GFXDEFS)
-
-# Define ASM defines here
-UADEFS =
-
-# List C source files here
-SRC = $(GFXSRC) \
- $(MYCSRC)
+ARCH =
+SRCFLAGS = -m32 -ggdb -O0 -fomit-frame-pointer -Wall -Wextra -Wstrict-prototypes -fverbose-asm
+CFLAGS =
+CXXFLAGS =
+ASFLAGS =
+LDFLAGS = -pthread
-# List ASM source files here
-ASRC =
+SRC =
+DEFS =
+LIBS =
+INCPATH =
+LIBPATH =
-# List all user directories here
-UINCDIR = $(MYFILES) $(GFXINC)
-
-# List the user directory to look for the libraries here
-ULIBDIR =
-
-# List all user libraries here
-ULIBS =
-
-# Define optimisation level here
-OPT = -ggdb -O0 -fomit-frame-pointer
-
-#
-# End of user defines
##############################################################################################
-
-# Output directory and files
-ifeq ($(MAKECMDGOALS),Debug)
- BUILDDIR = bin/Debug
-else ifeq ($(MAKECMDGOALS),Release)
- BUILDDIR = bin/Release
-else ifeq ($(MAKECMDGOALS),cleanDebug)
- BUILDDIR = bin/Debug
-else ifeq ($(MAKECMDGOALS),cleanRelease)
- BUILDDIR = bin/Release
-else ifeq ($(BUILDDIR),)
- BUILDDIR = .build
-else ifeq ($(BUILDDIR),.)
- BUILDDIR = .build
-endif
-
-OBJDIR = $(BUILDDIR)/obj
-LSTDIR = $(BUILDDIR)/lst
-MAPDIR = $(BUILDDIR)/map
-DEPDIR = .dep
-
-INCDIR = $(patsubst %,-I%,$(DINCDIR) $(UINCDIR))
-LIBDIR = $(patsubst %,-L%,$(DLIBDIR) $(ULIBDIR))
-DEFS = $(DDEFS) $(UDEFS)
-ADEFS = $(DADEFS) $(UADEFS)
-COBJ = $(addprefix $(OBJDIR)/, $(subst ../,_dot_dot/,$(SRC:.c=.o)))
-AOBJ = $(addprefix $(OBJDIR)/, $(subst ../,_dot_dot/,$(ASRC:.s=.o)))
-OBJS = $(AOBJ) $(COBJ)
-LIBS = $(DLIBS) $(ULIBS)
-
-ASFLAGS = $(ADEFS)
-CPFLAGS = $(OPT) -Wall -Wextra -Wstrict-prototypes -fverbose-asm $(DEFS)
-LDFLAGS = -Wl,-Map=$(MAPDIR)/$(PROJECT).map,--cref,--no-warn-mismatch $(LIBDIR)
-ifeq ($(USE_LISTING),yes)
- ASFLAGS += -Wa,-amhls=$(LSTDIR)/$(subst ../,_dot_dot/,$(<:.s=.lst))
- CPFLAGS += -Wa,-alms=$(LSTDIR)/$(subst ../,_dot_dot/,$(<:.c=.lst))
-endif
-
-ifeq ($(HOST_OSX),yes)
- ifeq ($(OSX_SDK),)
- OSX_SDK = /Developer/SDKs/MacOSX10.7.sdk
- endif
- ifeq ($(OSX_ARCH),)
- OSX_ARCH = -mmacosx-version-min=10.3 -arch i386
- endif
-
- LIBS += $(OSX_ARCH)
- CPFLAGS += -isysroot $(OSX_SDK) $(OSX_ARCH)
- LDFLAGS = -Wl -Map=$(MAPDIR)/$(PROJECT).map,-syslibroot,$(OSX_SDK),$(LIBDIR)
-else
- # Linux, or other
- CPFLAGS += -m32
-endif
-
-# Generate dependency information
-CPFLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d
-
-#
-# makefile rules
-#
-
-Debug Release: all
-
-cleanDebug cleanRelease: clean
-
-all: $(BUILDDIR) $(OBJS) $(PROJECT)
-
-$(BUILDDIR) $(OBJDIR) $(LSTDIR) $(MAPDIR):
- mkdir -p $(OBJDIR)
- mkdir -p $(MAPDIR)
-ifeq ($(USE_LISTING),yes)
- mkdir -p $(LSTDIR)
-endif
-ifneq ($(USE_VERBOSE_COMPILE),yes)
- @echo Compiler Options - $(CC) -c $(CPFLAGS) -I. $(INCDIR) main.c -o $(OBJDIR)/main.o
- @echo
-endif
-
-.SECONDEXPANSION:
-$(OBJDIR)/%.o : $$(subst _dot_dot/,../,%.c)
- @mkdir -p $(dir $@)
-ifeq ($(USE_VERBOSE_COMPILE),yes)
- @echo
- $(CC) -c $(CPFLAGS) -I. $(INCDIR) $< -o $@
-else
- @echo Compiling $<
- @$(CC) -c $(CPFLAGS) -I. $(INCDIR) $< -o $@
-endif
-
-$(OBJDIR)/%.o : $$(subst _dot_dot/,../,%.s)
- @mkdir -p $(dir $@)
-ifeq ($(USE_VERBOSE_COMPILE),yes)
- @echo
- $(AS) -c $(ASFLAGS) -I. $(INCDIR) $< -o $@
-else
- @echo Compiling $<
- @$(AS) -c $(ASFLAGS) -I. $(INCDIR) $< -o $@
-endif
-
-$(PROJECT): $(OBJS)
- $(CC) $(OBJS) $(LDFLAGS) $(LIBS) -o $@
-
-gcov:
- -mkdir gcov
- $(COV) -u $(subst /,\,$(SRC))
- -mv *.gcov ./gcov
-
-clean:
- -rm -fR $(BUILDDIR)
- -rm -fR $(DEPDIR)
-
-#
-# Include the dependency files, should be the last of the makefile
+# These should be at the end
#
--include $(shell mkdir $(DEPDIR) 2>/dev/null) $(wildcard $(DEPDIR)/*)
+include $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk
+include $(GFXLIB)/tools/gmake_scripts/compiler_gcc.mk
# *** EOF ***
diff --git a/boards/base/OSX/board.mk b/boards/base/OSX/board.mk
new file mode 100644
index 00000000..0d7da3f8
--- /dev/null
+++ b/boards/base/OSX/board.mk
@@ -0,0 +1,7 @@
+GFXINC += $(GFXLIB)/boards/base/OSX
+GFXSRC +=
+GFXDEFS += -DGFX_USE_OS_OSX=TRUE
+GFXLIBS += rt
+
+include $(GFXLIB)/drivers/multiple/X/driver.mk
+
diff --git a/boards/base/OSX/example/Makefile b/boards/base/OSX/example/Makefile
new file mode 100644
index 00000000..d3502528
--- /dev/null
+++ b/boards/base/OSX/example/Makefile
@@ -0,0 +1,47 @@
+# Possible Targets: all clean Debug cleanDebug Release cleanRelease
+
+##############################################################################################
+# Settings
+#
+
+# See $(GFXLIB)/tools/gmake_scripts/readme.txt for the meaning of these variables
+OPT_VERBOSE_COMPILE = no
+OPT_GENERATE_LISTINGS = yes
+OPT_GENERATE_MAP = yes
+OPT_COPY_EXE = no
+OPT_NATIVEOS = osx
+OPT_OS = osx
+
+# See $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk for the meaning of these variables
+GFXLIB = ../uGFX
+GFXBOARD = OSX
+#GFXDRIVERS = multiple/uGFXnet
+GFXDEMO = modules/gdisp/basics
+
+##############################################################################################
+# Set these for your project
+#
+
+OSX_SDK = /Developer/SDKs/MacOSX10.7.sdk
+OSX_ARCH = -mmacosx-version-min=10.3 -arch i386
+
+ARCH =
+SRCFLAGS = -m32 -ggdb -O0 -fomit-frame-pointer -Wall -Wextra -Wstrict-prototypes -fverbose-asm -isysroot $(OSX_SDK) $(OSX_ARCH)
+CFLAGS =
+CXXFLAGS =
+ASFLAGS =
+LDFLAGS = -pthread -Wl,-syslibroot,$(OSX_SDK) $(OSX_ARCH)
+
+SRC =
+DEFS =
+LIBS =
+INCPATH =
+LIBPATH =
+
+##############################################################################################
+# These should be at the end
+#
+
+include $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk
+include $(GFXLIB)/tools/gmake_scripts/compiler_gcc.mk
+# *** EOF ***
diff --git a/boards/base/OSX/example/readme.txt b/boards/base/OSX/example/readme.txt
new file mode 100644
index 00000000..aff58bb1
--- /dev/null
+++ b/boards/base/OSX/example/readme.txt
@@ -0,0 +1,5 @@
+Copy these files into your own project directory and alter them to suite.
+
+Notes:
+
+1/ Look at the MYFILES definition and the MYCSRC definition.
diff --git a/boards/base/OSX/readme.txt b/boards/base/OSX/readme.txt
new file mode 100644
index 00000000..df033cbe
--- /dev/null
+++ b/boards/base/OSX/readme.txt
@@ -0,0 +1,7 @@
+This directory contains the interface for OSX using X.
+
+On this board uGFX currently supports:
+ - GDISP via the X driver
+ - GINPUT-touch via the X driver
+
+There is an example Makefile and project in the examples directory.
diff --git a/boards/base/Win32/board.mk b/boards/base/Win32/board.mk
index 69d09100..adcbaeaf 100644
--- a/boards/base/Win32/board.mk
+++ b/boards/base/Win32/board.mk
@@ -1,5 +1,5 @@
-GFXINC += $(GFXLIB)/boards/base/Win32
+GFXINC +=
GFXSRC +=
-
+GFXLIBS +=
include $(GFXLIB)/drivers/multiple/Win32/driver.mk
include $(GFXLIB)/drivers/gaudio/Win32/driver.mk
diff --git a/boards/base/Win32/example/Makefile b/boards/base/Win32/example/Makefile
index 7d54ac02..502cf1ac 100644
--- a/boards/base/Win32/example/Makefile
+++ b/boards/base/Win32/example/Makefile
@@ -1,239 +1,73 @@
-#
-# !!!! Do NOT edit this makefile with an editor which replace tabs by spaces !!!!
-#
-##############################################################################################
-#
-# On command line:
-#
-# make all = Create project
-#
-# make clean = Clean project files.
-#
-# To rebuild project do "make clean" and "make all".
-#
+# Possible Targets: all clean Debug cleanDebug Release cleanRelease
##############################################################################################
-# Start of make control
+# Settings
#
-# Turn ChibiOS simimulator on or off?
-USE_CHIBIOS=no
+# See $(GFXLIB)/tools/gmake_scripts/readme.txt for the meaning of these variables
+OPT_VERBOSE_COMPILE = no
+OPT_GENERATE_LISTINGS = yes
+OPT_GENERATE_MAP = yes
+OPT_COPY_EXE = no
+OPT_NATIVEOS = win32
+OPT_OS = win32
-# Verbose compiling?
-USE_VERBOSE_COMPILE=no
-
-# Generate listing files?
-USE_LISTING=no
+# See $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk for the meaning of these variables
+GFXLIB = ../uGFX
+GFXBOARD = Win32
+#GFXDRIVERS = multiple/uGFXnet
+GFXDEMO = modules/gdisp/basics
-# Your project name and executable file name - Optional, defaults to the project directory name
-#PROJECT=uGFX
+# Win32 - ChibiOS simulator
+ifeq ($(OPT_OS),chibios)
+ # Required: Location of the ChibiOS code
+ CHIBIOS = ../ChibiOS
+endif
-#
-# End of make control
-##############################################################################################
##############################################################################################
-# Start of default section
+# Set these for your project
#
-CC = i686-pc-mingw32-gcc -g
-
-# List all default C defines here, like -D_DEBUG=1
-DDEFS =
-
-# List all default directories to look for include files here
-DINCDIR =
+ARCH = i686-pc-mingw32-
+SRCFLAGS = -ggdb -O0 -fomit-frame-pointer -Wall -Wextra -Wstrict-prototypes -fverbose-asm
+CFLAGS =
+CXXFLAGS =
+ASFLAGS =
+LDFLAGS =
-# List the default directory to look for the libraries here
-DLIBDIR =
-
-# List all default libraries here
-DLIBS = -lws2_32 -lgdi32 -lwinmm
-
-# Make sure this empty for now
-SRC =
-
-#
-# End of default section
-##############################################################################################
+SRC =
+DEFS =
+LIBS =
+INCPATH =
+LIBPATH =
##############################################################################################
-# Start of user section
+# Optional: Win32 - ChibiOS Simulator
#
-# Imported source files and paths for uGFX
-GFXLIB = ../uGFX
-include $(GFXLIB)/gfx.mk
-include $(GFXLIB)/boards/base/Win32/board.mk
-
-# Imported source files and paths for ChibiOS
-ifeq ($(USE_CHIBIOS),yes)
- CHIBIOS = ../ChibiOS
+ifeq ($(OPT_OS),chibios)
include $(CHIBIOS)/boards/simulator/board.mk
- include ${CHIBIOS}/os/hal/hal.mk
- include ${CHIBIOS}/os/hal/platforms/Win32/platform.mk
- include ${CHIBIOS}/os/ports/GCC/SIMIA32/port.mk
- include ${CHIBIOS}/os/kernel/kernel.mk
- DDEFS += -DSIMULATOR -DSHELL_USE_IPRINTF=FALSE
- UINCDIR += $(PORTINC) $(KERNINC) $(TESTINC) \
+ include $(CHIBIOS)/os/hal/hal.mk
+ include $(CHIBIOS)/os/hal/platforms/Win32/platform.mk
+ include $(CHIBIOS)/os/ports/GCC/SIMIA32/port.mk
+ include $(CHIBIOS)/os/kernel/kernel.mk
+ DEFS += SIMULATOR SHELL_USE_IPRINTF=FALSE
+ INCPATH += $(PORTINC) $(KERNINC) $(TESTINC) \
$(HALINC) $(PLATFORMINC) $(BOARDINC)
- # ${CHIBIOS}/os/various
- SRC += ${PORTSRC} \
- ${KERNSRC} \
- ${TESTSRC} \
- ${HALSRC} \
- ${PLATFORMSRC} \
- $(BOARDSRC)
- GFXDEFS += -DGFX_USE_OS_CHIBIOS=TRUE
-else
- GFXDEFS += -DGFX_USE_OS_WIN32=TRUE
+ # $(CHIBIOS)/os/various
+ SRC += $(PORTSRC) \
+ $(KERNSRC) \
+ $(TESTSRC) \
+ $(HALSRC) \
+ $(PLATFORMSRC) \
+ $(BOARDSRC)
endif
-# Where is our source code - alter these for your project.
-# Either just include the demo makefile or add your own definitions
-include $(GFXLIB)/demos/modules/gdisp/basics/demo.mk
-#MYFILES = my-project-directory
-#MYCSRC = $(MYFILES)/main.c
-#MYDEFS =
-
-# List C source files here
-SRC += ${GFXSRC} \
- ${MYCSRC}
-
-# List all user C define here, like -D_DEBUG=1
-UDEFS = ${GFXDEFS}
-
-# List all user directories here
-UINCDIR = ${GFXINC} \
- ${MYFILES}
-
-# List the user directory to look for the libraries here
-ULIBDIR =
-
-# List all user libraries here
-ULIBS =
-
-# Define optimisation level here
-#OPT = -ggdb -O2 -fomit-frame-pointer
-OPT = -ggdb -O0 -fomit-frame-pointer
-
-#
-# End of user defines
##############################################################################################
-
-
-# Default project name is the project directory name
-ifeq ($(PROJECT),)
- PROJECT := $(notdir $(patsubst %/,%,$(dir $(abspath $(firstword $(MAKEFILE_LIST))))))
-endif
-
-# Output directory and files
-ifeq ($(MAKECMDGOALS),Debug)
- BUILDDIR = bin/Debug
-else ifeq ($(MAKECMDGOALS),Release)
- BUILDDIR = bin/Release
-else ifeq ($(MAKECMDGOALS),cleanDebug)
- BUILDDIR = bin/Debug
-else ifeq ($(MAKECMDGOALS),cleanRelease)
- BUILDDIR = bin/Release
-else ifeq ($(BUILDDIR),)
- BUILDDIR = .build
-else ifeq ($(BUILDDIR),.)
- BUILDDIR = .build
-endif
-
-OBJDIR = $(BUILDDIR)/obj
-LSTDIR = $(BUILDDIR)/lst
-MAPDIR = $(BUILDDIR)/map
-DEPDIR = .dep
-
-INCDIR = $(patsubst %,-I%,$(DINCDIR) $(UINCDIR))
-LIBDIR = $(patsubst %,-L%,$(DLIBDIR) $(ULIBDIR))
-DEFS = $(DDEFS) $(UDEFS)
-ADEFS = $(DADEFS) $(UADEFS)
-COBJ = $(addprefix $(OBJDIR)/, $(subst ../,_dot_dot/,$(SRC:.c=.o)))
-AOBJ = $(addprefix $(OBJDIR)/, $(subst ../,_dot_dot/,$(ASRC:.s=.o)))
-OBJS = $(AOBJ) $(COBJ)
-LIBS = $(DLIBS) $(ULIBS)
-
-LDFLAGS = -Wl,-Map=$(MAPDIR)/$(PROJECT).map,--cref,--no-warn-mismatch $(LIBDIR)
-CPFLAGS = $(OPT) -Wall -Wextra -Wstrict-prototypes -fverbose-asm $(DEFS)
-ifeq ($(USE_LISTING),yes)
- CPFLAGS += -Wa,-alms=$(LSTDIR)/$(<:.c=.lst)
-endif
-
-# Generate dependency information
-CPFLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d
-
-#
-# makefile rules
-#
-
-Debug Release: all
-
-cleanDebug cleanRelease: clean
-
-all: $(BUILDDIR) $(OBJS) $(BUILDDIR)/$(PROJECT).exe MAKE_ALL_RULE_HOOK
-#all: main.cp
-
-main.cp: $(MYCSRC)
- $(CC) -c $(CPFLAGS) -E -P -I. $(INCDIR) $< -o $@
-
-MAKE_ALL_RULE_HOOK:
-
-$(BUILDDIR) $(OBJDIR) $(LSTDIR):
- mkdir -p $(OBJDIR)
- mkdir -p $(MAPDIR)
-ifeq ($(USE_LISTING),yes)
- mkdir -p $(LSTDIR)
-endif
-ifneq ($(USE_VERBOSE_COMPILE),yes)
- @echo Compiler Options - $(CC) -c $(CPFLAGS) -I. $(INCDIR) main.c -o $(OBJDIR)/main.o
- @echo
-endif
-
-.SECONDEXPANSION:
-$(OBJDIR)/%.o : $$(subst _dot_dot/,../,%.c)
- @mkdir -p $(dir $@)
-ifeq ($(USE_VERBOSE_COMPILE),yes)
- @echo
- $(CC) -c $(CPFLAGS) -I. $(INCDIR) $< -o $@
-else
- @echo Compiling $<
- @$(CC) -c $(CPFLAGS) -I. $(INCDIR) $< -o $@
-endif
-
-$(OBJDIR)/%.o : $$(subst _dot_dot/,../,%.s)
- @mkdir -p $(dir $@)
-ifeq ($(USE_VERBOSE_COMPILE),yes)
- @echo
- $(AS) -c $(ASFLAGS) -I. $(INCDIR) $< -o $@
-else
- @echo Compiling $<
- @$(AS) -c $(ASFLAGS) -I. $(INCDIR) $< -o $@
-endif
-
-%.exe: $(OBJS)
-ifeq ($(USE_VERBOSE_COMPILE),yes)
- @echo
- $(CC) $(OBJS) $(LDFLAGS) $(LIBS) -o $@
-else
- @echo Linking $@
- @$(CC) $(OBJS) $(LDFLAGS) $(LIBS) -o $@
-endif
-
-gcov:
- -mkdir gcov
- $(COV) -u $(subst /,\,$(SRC))
- -mv *.gcov ./gcov
-
-clean:
- -rm -fR $(BUILDDIR)
- -rm -fR $(DEPDIR)
-
-#
-# Include the dependency files, should be the last of the makefile
+# These should be at the end
#
--include $(shell mkdir $(DEPDIR) 2>/dev/null) $(wildcard $(DEPDIR)/*)
+include $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk
+include $(GFXLIB)/tools/gmake_scripts/compiler_gcc.mk
# *** EOF ***