Cygwin support

This commit is contained in:
Thog
2017-05-17 23:56:38 +02:00
parent 7dcc166403
commit a521cd7abd
5 changed files with 33 additions and 27 deletions
+14 -12
View File
@@ -5,22 +5,24 @@ OBJS = $(foreach dir,$(SRC_DIR),$(subst .c,.o,$(wildcard $(dir)/*.c)))
# Compiler Settings
CFLAGS = --std=gnu99 -O2 -Wall -Wno-unused-value -Wno-unused-result -I.
CC = gcc
ifeq ($(OS),Windows_NT)
SYS := $(shell gcc -dumpmachine)
ifneq (, $(findstring linux, $(SYS)))
# Linux
CFLAGS += -Wno-unused-but-set-variable
else ifneq(, $(findstring cygwin, $(SYS)))
# Cygwin
CFLAGS += -Wno-unused-but-set-variable
LIBS += -liconv
else ifneq(, $(findstring darwin, $(SYS)))
# OS X
LIBS += -liconv
else
#Windows Build CFG
CFLAGS += -Wno-unused-but-set-variable
LIBS += -static-libgcc
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
# OS X
LIBS += -liconv
else
# Linux
CFLAGS += -Wno-unused-but-set-variable
endif
endif
# MAKEROM Build Settings
OUTPUT = makerom
@@ -29,7 +31,7 @@ main: build
rebuild: clean build
build: $(OBJS)
$(CC) -o $(OUTPUT) $(LIBS) $(OBJS)
$(CC) -o $(OUTPUT) $(OBJS) $(LIBS)
clean:
rm -rf $(OUTPUT) $(OBJS)
+2
View File
@@ -1,6 +1,8 @@
#include <stdlib.h>
#ifndef _WIN32
#ifndef __CYGWIN__
#define LIBICONV_PLUG
#endif
#include <iconv.h>
#endif
#include "oschar.h"