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