+st_term_SOURCES = src/st-term.c
+st_info_SOURCES = src/st-info.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
+
+if !MINGW
+CFILES += src/st-term.c
+endif
+
+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)