Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Windows support #146

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'dev' into dev-win-support
  • Loading branch information
snake-4 committed Nov 18, 2021
commit 4367daec9f54203d63b9c33866a39f6ab3a782fd
23 changes: 14 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,25 @@ else
LIMESDR ?= no
endif

HOST_UNAME := $(shell uname)
HOST_ARCH := $(shell uname -m)

# There is no standard for the uname's output on a Windows environment
ifeq ($(OS),Windows_NT)
DETECTED_OS := Windows
else
DETECTED_OS := $(shell sh -c 'uname 2>/dev/null || echo Unknown')
HOST_UNAME := Windows
endif

ifeq ($(DETECTED_OS), Linux)
UNAME ?= $(HOST_UNAME)
ARCH ?= $(HOST_ARCH)

ifeq ($(UNAME), Linux)
LIBS += -lrt
LIBS_USB += -lusb-1.0
LIBS_CURSES := -lncurses
CPUFEATURES ?= yes
endif

ifeq ($(DETECTED_OS), Darwin)
ifeq ($(UNAME), Darwin)
ifneq ($(shell sw_vers -productVersion | egrep '^10\.([0-9]|1[01])\.'),) # Mac OS X ver <= 10.11
CPPFLAGS += -DMISSING_GETTIME
COMPAT += compat/clock_gettime/clock_gettime.o
Expand All @@ -64,27 +69,27 @@ ifeq ($(DETECTED_OS), Darwin)
CPUFEATURES ?= yes
endif

ifeq ($(DETECTED_OS), OpenBSD)
ifeq ($(UNAME), OpenBSD)
CPPFLAGS += -DMISSING_NANOSLEEP
COMPAT += compat/clock_nanosleep/clock_nanosleep.o
LIBS_USB += -lusb-1.0
LIBS_CURSES := -lncurses
CPUFEATURES ?= yes
endif

ifeq ($(DETECTED_OS), FreeBSD)
ifeq ($(UNAME), FreeBSD)
LIBS += -lrt
LIBS_USB += -lusb
LIBS_CURSES := -lncurses
endif

ifeq ($(DETECTED_OS), NetBSD)
ifeq ($(UNAME), NetBSD)
LIBS += -lrt
LIBS_USB += -lusb-1.0
LIBS_CURSES := -lcurses
endif

ifeq ($(DETECTED_OS), Windows)
ifeq ($(UNAME), Windows)
# TODO: Perhaps copy the DLL files to the output folder if the OS is Windows?
CPPFLAGS += -DMISSING_TIME_R_FUNCS -DMISSING_CURSES_H_NCURSES -D_USE_MATH_DEFINES
LIBS += -lws2_32 -lsystre
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.