Whatever changes I made since 1.31

This commit is contained in:
Alcaro
2016-01-17 18:15:18 +01:00
parent 24e6c77eb8
commit 990ee08ddb
13 changed files with 335 additions and 153 deletions

View File

@@ -3,19 +3,20 @@ CFLAGS_windows := -DFLIPS_WINDOWS -mwindows -lgdi32 -lcomdlg32 -lcomctl32 -luser
CFLAGS_win := $(CFLAGS_windows)
CFLAGS_cli := -DFLIPS_CLI
CFLAGS_G = -fno-rtti -fno-exceptions
CFLAGS_G = -fno-rtti -fno-exceptions -DNDEBUG
FNAME_gtk := flips
FNAME_windows := flips.exe
FNAME_win := $(FNAME_windows)
FNAME_cli := flips
CXX = g++
XFILES :=
SOURCES := *.cpp
ifeq ($(TARGET),)
targetmachine := $(shell $(CC) -dumpmachine)
targetmachine := $(shell $(CXX) -dumpmachine)
ifneq ($(findstring mingw,$(targetmachine)),)
TARGET := windows
else ifneq ($(findstring linux,$(targetmachine)),)
@@ -48,7 +49,7 @@ ifeq ($(TARGET),gtk)
endif
ifeq ($(GTKFLAGS),)
$(warning pkg-config can't find gtk+-3.0, or pkg-config itself can't be found)
$(warning if you have the needed files installed, specify their locations and names with `make 'GTKFLAGS=-I/usr/include' 'GTKLIBS=-L/usr/lib -lgtk'')
$(warning if you have the needed files installed, specify their locations and names with `make GTKFLAGS='-I/usr/include' GTKLIBS='-L/usr/lib -lgtk'')
$(warning if not, the package name under Debian and derivates is `libgtk-3-dev'; on other distros, consult a search engine)
$(warning switching to CLI build)
TARGET := cli
@@ -71,20 +72,21 @@ ifneq ($(DIVSUF),no)
DIVSUF := $(subst /include/config.h,,$(DIVSUF_EXIST))
ifneq ($(DIVSUF),)
DIVSUF_SOURCES := $(filter-out %/utils.c,$(wildcard $(DIVSUF)/lib/*.c))
ifeq ($(DIVSUF_OPENMP),)
ifeq ($(TARGET),gtk)
DIVSUF_OPENMP := -fopenmp
endif
endif
DIVSUF_CFLAGS := -DUSE_DIVSUFSORT -I$(DIVSUF)/include -DHAVE_CONFIG_H -DNDEBUG -D__STDC_FORMAT_MACROS $(DIVSUF_OPENMP)
DIVSUF_CFLAGS := -I$(DIVSUF)/include -DHAVE_CONFIG_H -D__STDC_FORMAT_MACROS
DIVSUF_LFLAGS :=
MOREFLAGS += $(DIVSUF_CFLAGS) $(DIVSUF_SOURCES) $(DIVSUF_LFLAGS)
else
$(warning no libdivsufsort-2.x detected; switching to fallback SA-IS)
$(warning libdivsufsort is approximately twice as fast as SA-IS)
$(warning no libdivsufsort-2.x detected; switching to fallback libdivsufsort-lite)
$(warning libdivsufsort is approximately 3% faster than lite)
SOURCES += divsufsort.c
endif
else
SOURCES += divsufsort.c
endif
ifeq ($(TARGET),gtk)
CFLAGS_G += -fopenmp
endif
$(FNAME_$(TARGET)): *.cpp $(XFILES)
$(FNAME_$(TARGET)): $(SOURCES) $(XFILES)
$(CXX) $^ -std=c++98 $(CFLAGS) $(LFLAGS) $(CFLAGS_G) $(MOREFLAGS) $(XFILES) -o$@