Fix building on MSYS2
This commit is contained in:
13
Makefile
13
Makefile
@@ -1,12 +1,13 @@
|
|||||||
|
|
||||||
ifneq (,$(findstring MINGW,$(shell uname -s)))
|
IsMinGW=$(findstring MSYS,$(shell uname -s)) $(findstring MINGW,$(shell uname -s))
|
||||||
|
ifneq (,$(IsMinGW))
|
||||||
RES_APP = filesync.exe
|
RES_APP = filesync.exe
|
||||||
BUILDDIR = build-mingw
|
BUILDDIR = build-mingw
|
||||||
else
|
else
|
||||||
RES_APP = filesync
|
RES_APP = filesync
|
||||||
BUILDDIR = build-linux
|
BUILDDIR = build-linux
|
||||||
endif
|
endif
|
||||||
|
VERBOSE_BUILD=false
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
RM = rm -f
|
RM = rm -f
|
||||||
@@ -39,8 +40,16 @@ CFLAGS = -g
|
|||||||
LIBS = -lm
|
LIBS = -lm
|
||||||
|
|
||||||
|
|
||||||
|
ifeq ($(VERBOSE_BUILD),true)
|
||||||
|
DO_CC=$(CC) $(CFLAGS) -o $@ -c $<
|
||||||
|
DO_CXX=$(CXX) $(CFLAGS) -o $@ -c $<
|
||||||
|
else
|
||||||
DO_CC=@$(ECHO) "CC: $@" ;\
|
DO_CC=@$(ECHO) "CC: $@" ;\
|
||||||
$(CC) $(CFLAGS) -o $@ -c $<
|
$(CC) $(CFLAGS) -o $@ -c $<
|
||||||
|
DO_CXX=@$(ECHO) "CXX: $@" ;\
|
||||||
|
$(CXX) $(CFLAGS) -o $@ -c $<
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
all: $(RES_APP)
|
all: $(RES_APP)
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,21 @@
|
|||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <time.h>
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
# include <direct.h>
|
|
||||||
# define _WIN32_WINNT 0x0501
|
# define _WIN32_WINNT 0x0501
|
||||||
|
# include <direct.h>
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
# include <io.h>
|
# include <io.h>
|
||||||
# include <stdio.h>
|
# include <stdio.h>
|
||||||
# include <signal.h>
|
# include <signal.h>
|
||||||
# include <fcntl.h>
|
# include <fcntl.h>
|
||||||
|
# include <sys/types.h>
|
||||||
|
# include <sys/stat.h>
|
||||||
|
# include <time.h>
|
||||||
#else
|
#else
|
||||||
|
# include <stdio.h>
|
||||||
|
# include <string.h>
|
||||||
|
# include <sys/types.h>
|
||||||
|
# include <sys/stat.h>
|
||||||
|
# include <time.h>
|
||||||
# include <utime.h>
|
# include <utime.h>
|
||||||
# include <dirent.h>
|
# include <dirent.h>
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user