forked from stlink-org/stlink
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request stlink-org#77 from WinterMute/mingw
Changes to allow compiling for windows using mingw toolchains
- Loading branch information
Showing
18 changed files
with
679 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,29 @@ | ||
nbproject | ||
.project | ||
COPYING | ||
INSTALL | ||
Makefile.in | ||
aclocal.m4 | ||
autom4te.cache | ||
config.guess | ||
config.sub | ||
configure | ||
depcomp | ||
install-sh | ||
ltmain.sh | ||
missing | ||
*.bz2 | ||
*.lo | ||
*.o | ||
*.elf | ||
doc/tutorial/*.log | ||
doc/tutorial/*.aux | ||
libstlink.a | ||
test_usb | ||
test_sg | ||
gdbserver/st-util | ||
flash/flash | ||
*.log | ||
example/*/*.bin | ||
example/*/*.elf | ||
example/*/*/*.bin | ||
example/*/*/*/*.bin | ||
example/*/*/*.a | ||
example/*/*/*/*.a | ||
.libs | ||
libtool | ||
*.la | ||
config.log | ||
config.status | ||
compile | ||
st-flash | ||
st-util | ||
*.deps* | ||
*.dirstamp | ||
*.a | ||
Makefile | ||
*.exe | ||
example/blink/*.elf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Makefile.am -- Process this file with automake to produce Makefile.in | ||
|
||
AUTOMAKE_OPTIONS = subdir-objects | ||
|
||
bin_PROGRAMS = st-flash st-util | ||
|
||
noinst_LIBRARIES = libstlink.a | ||
|
||
st_flash_SOURCES = flash/main.c | ||
st_util_SOURCES = gdbserver/gdb-remote.c gdbserver/gdb-remote.h gdbserver/gdb-server.c mingw/mingw.c mingw/mingw.h | ||
|
||
CFILES = \ | ||
src/stlink-common.c \ | ||
src/stlink-usb.c \ | ||
src/stlink-sg.c \ | ||
src/uglylogging.c | ||
|
||
HFILES = \ | ||
src/stlink-common.h \ | ||
src/stlink-usb.h \ | ||
src/stlink-sg.h \ | ||
src/uglylogging.h \ | ||
src/mmap.h | ||
|
||
libstlink_a_SOURCES = $(CFILES) $(HFILES) | ||
|
||
libstlink_a_CPPFLAGS = -std=gnu99 -Wall -Wextra -O2 | ||
libstlink_a_LIBADD = $(LIBOBJS) | ||
|
||
st_flash_LDADD = libstlink.a | ||
st_flash_CPPFLAGS = -std=gnu99 -Wall -Wextra -O2 -I$(top_srcdir)/src -I$(top_srcdir)/mingw | ||
|
||
st_util_LDADD = libstlink.a | ||
st_util_CPPFLAGS = -std=gnu99 -Wall -Wextra -O2 -I$(top_srcdir)/src -I$(top_srcdir)/mingw | ||
|
||
EXTRA_DIST = autogen.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
autoreconf --install --force --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# -*- Autoconf -*- | ||
# Process this file with autoconf to produce a configure script. | ||
|
||
AC_PREREQ(2.61) | ||
AC_INIT([stlink],[0.5.2],[[email protected]]) | ||
AC_CONFIG_SRCDIR([src/stlink-common.c]) | ||
AC_CONFIG_LIBOBJ_DIR([src]) | ||
AM_INIT_AUTOMAKE([1.10]) | ||
|
||
|
||
# Checks for programs. | ||
AC_PROG_CC | ||
AC_PROG_INSTALL | ||
AC_CANONICAL_HOST | ||
AC_CANONICAL_BUILD | ||
AC_PROG_RANLIB | ||
AM_PROG_CC_C_O | ||
|
||
AC_CHECK_HEADERS(sys/mman.h) | ||
AC_CHECK_HEADERS(sys/poll.h) | ||
AC_CHECK_FUNCS(mmap) | ||
AC_REPLACE_FUNCS(mmap pread) | ||
|
||
# Checks for libraries. | ||
PKG_CHECK_MODULES(USB, libusb-1.0 >= 1.0.0,, | ||
AC_MSG_ERROR([*** Required libusb-1.0 >= 1.0.0 not installed ***])) | ||
AC_CHECK_LIB([usbpath],[usb_path2devnum],,,-lusb) | ||
|
||
LIBS="$LIBS $USB_LIBS" | ||
CFLAGS="$CFLAGS $USB_CFLAGS" | ||
|
||
case "${host}" in | ||
*-mingw32*) | ||
LIBS="$LIBS -lws2_32" | ||
CPPFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $CPPFLAGS" | ||
;; | ||
esac | ||
AC_CONFIG_FILES([Makefile]) | ||
AC_OUTPUT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/* missing type */ | ||
|
||
typedef unsigned int uint32_t; | ||
|
||
void main(void); | ||
|
||
/* hardware configuration */ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.