Merge pull request #16 from woodsts/cygwin-build

Makefile: Fix Cygwin build
This commit is contained in:
Daniel Beer 2016-08-30 10:59:29 +12:00 committed by GitHub
commit 97641b3bb2
1 changed files with 18 additions and 12 deletions

View File

@ -25,6 +25,9 @@ BINDIR = ${PREFIX}/bin/
MANDIR = ${PREFIX}/share/man/man1 MANDIR = ${PREFIX}/share/man/man1
LIBDIR = ${PREFIX}/lib/ LIBDIR = ${PREFIX}/lib/
UNAME_S := $(shell sh -c 'uname -s')
UNAME_O := $(shell sh -c 'uname -o 2> /dev/null')
ifdef WITHOUT_READLINE ifdef WITHOUT_READLINE
READLINE_CFLAGS = READLINE_CFLAGS =
READLINE_LIBS = READLINE_LIBS =
@ -38,17 +41,15 @@ endif
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
MSPDEBUG_CC = $(CC) MSPDEBUG_CC = $(CC)
BINARY = mspdebug.exe BINARY = mspdebug.exe
ifneq ($(UNAME_O),Cygwin) ifneq ($(UNAME_O),Cygwin)
OS_LIBS = -lws2_32 -lregex OS_LIBS = -lws2_32 -lregex
OS_CFLAGS = -D__Windows__ -DNO_SHELLCMD OS_CFLAGS = -D__Windows__ -DNO_SHELLCMD
RM = del
endif endif
else else
MSPDEBUG_CC = $(CC) MSPDEBUG_CC = $(CC)
BINARY = mspdebug BINARY = mspdebug
UNAME_S := $(shell sh -c 'uname -s')
UNAME_O := $(shell sh -c 'uname -o 2> /dev/null')
ifneq ($(filter $(UNAME_S),OpenBSD NetBSD),) ifneq ($(filter $(UNAME_S),OpenBSD NetBSD),)
OS_LIBS = OS_LIBS =
@ -92,17 +93,22 @@ all: $(BINARY)
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
clean: clean:
del drivers\*.o ifeq ($(UNAME_O),Cygwin)
del formats\*.o $(RM) */*.o
del simio\*.o $(RM) $(BINARY)
del transport\*.o else
del ui\*.o $(RM) drivers\*.o
del util\*.o $(RM) formats\*.o
del $(BINARY) $(RM) simio\*.o
$(RM) transport\*.o
$(RM) ui\*.o
$(RM) util\*.o
$(RM) $(BINARY)
endif
else else
clean: clean:
rm -f */*.o $(RM) */*.o
rm -f $(BINARY) $(RM) $(BINARY)
endif endif
install: $(BINARY) mspdebug.man install: $(BINARY) mspdebug.man