Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Makefile flags to ease building on Cygwin #855

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Specify the name of the resulting executable file
name = sc-im

# Specify some Options

## Build in cygwin environment with previously compiled libxlsxwriter
O_CYGWIN ::= 0
O_LIBXLSXWRITER_ROOT ::= "../../libxlsxwriter"

# The base directory where everything should be installed.
prefix = /usr/local

Expand Down Expand Up @@ -133,6 +139,13 @@ ifneq (, $(shell which pkg-config))
LDLIBS += $(shell pkg-config --libs xlsxwriter)
endif

# NOTE: compile with required libxlsxwriter for export support on Cygwin
ifeq ($(O_CYGWIN), 1)
CFLAGS += -DXLSX_EXPORT -I$(prefix)/include
LDLIBS += -I $(prefix)/include -L $(O_LIBXLSXWRITER_ROOT)/lib
LDLIBS += -lxlsxwriter -lz
endif

# NOTE: lua support
LUA_PKGNAME ?= $(shell pkg-config --list-all | awk '/^lua-?[0-9.]+[[:space:]]/ { p=$$1; gsub("[^[0-9]", "", p); print p " " $$1; }' | LC_ALL=C sort -nrk1 | uniq | head -n 1 | awk '{print $$2}')
ifneq ($(LUA_PKGNAME),)
Expand Down