Fix building on MSYS2
This commit is contained in:
15
Makefile
15
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
|
||||
BUILDDIR = build-mingw
|
||||
else
|
||||
RES_APP = filesync
|
||||
BUILDDIR = build-linux
|
||||
endif
|
||||
|
||||
VERBOSE_BUILD=false
|
||||
|
||||
CC = gcc
|
||||
RM = rm -f
|
||||
@@ -39,8 +40,16 @@ CFLAGS = -g
|
||||
LIBS = -lm
|
||||
|
||||
|
||||
DO_CC=@$(ECHO) "CC: $@" ;\
|
||||
ifeq ($(VERBOSE_BUILD),true)
|
||||
DO_CC=$(CC) $(CFLAGS) -o $@ -c $<
|
||||
DO_CXX=$(CXX) $(CFLAGS) -o $@ -c $<
|
||||
else
|
||||
DO_CC=@$(ECHO) "CC: $@" ;\
|
||||
$(CC) $(CFLAGS) -o $@ -c $<
|
||||
DO_CXX=@$(ECHO) "CXX: $@" ;\
|
||||
$(CXX) $(CFLAGS) -o $@ -c $<
|
||||
endif
|
||||
|
||||
|
||||
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
|
||||
# include <direct.h>
|
||||
# define _WIN32_WINNT 0x0501
|
||||
# include <direct.h>
|
||||
# include <windows.h>
|
||||
# include <io.h>
|
||||
# include <stdio.h>
|
||||
# include <signal.h>
|
||||
# include <fcntl.h>
|
||||
# include <sys/types.h>
|
||||
# include <sys/stat.h>
|
||||
# include <time.h>
|
||||
#else
|
||||
# include <stdio.h>
|
||||
# include <string.h>
|
||||
# include <sys/types.h>
|
||||
# include <sys/stat.h>
|
||||
# include <time.h>
|
||||
# include <utime.h>
|
||||
# include <dirent.h>
|
||||
# include <unistd.h>
|
||||
|
||||
Reference in New Issue
Block a user