mirror of
https://github.com/ProDOS-8/xHD.git
synced 2024-11-29 04:49:16 +00:00
5afd68109d
On everything but Windows building xHDServer is so trivial that everything more than a minimal Makefile is inappropriate. On Windows requiring an additional tool (like e.g. CMake) is just another obstacle. However, GNUmake comes with Mingw-w64. In order to optimize the user experience it is desirable to build with a static variant of libserialport. However, doing so requires on Windows in general import libraries for all DLLs referred to by libserialport. For cfgmgr32.lib and setupapi.lib this would require the installation of the Platform SDK. But fortunately the Mingw variant of ld is able to link directly against DLLs instead of import libraries (see https://sourceware.org/binutils/docs-2.17/ld/WIN32.html). The line LDLIBS += -lcfgmgr32 -lsetupapi in the Makefile makes use of that feature. ld even finds the two DLLs in Windows\System32 without further hint.
18 lines
258 B
Makefile
18 lines
258 B
Makefile
xHDServer: main.o
|
|
$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
|
|
|
|
LDLIBS = -lserialport
|
|
|
|
ifeq ($(OS),Windows_NT)
|
|
|
|
LDLIBS += -lcfgmgr32 -lsetupapi
|
|
|
|
CC = gcc
|
|
CXX = g++
|
|
CPPFLAGS = -m64 -I win32
|
|
LDFLAGS = -m64 -L win32
|
|
|
|
xHDServer: win32/mmap-win32.o
|
|
|
|
endif # Windows_NT
|