-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
36 lines (29 loc) · 783 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
PACKAGE_NAME := pyfastexcel
ifeq ($(OS),Windows_NT)
# Windows
SHARED_LIBRARY := pyfastexcel.dll
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
# Linux
SHARED_LIBRARY := pyfastexcel.so
else ifeq ($(UNAME_S),Darwin)
# macOS
SHARED_LIBRARY := pyfastexcel.dylib
endif
endif
GO_SOURCE := pyfastexcel.go
CGO_FLAGS := -buildmode=c-shared
TARGET_FOLDER := ./pyfastexcel
CLEAN_CMD := rm -f $(SHARED_LIBRARY)
all: build
build: $(SHARED_LIBRARY)
$(SHARED_LIBRARY): $(GO_SOURCE)
@echo "Building shared library..."
go build $(CGO_FLAGS) -o $(TARGET_FOLDER)/$(SHARED_LIBRARY)
clean:
@echo "Cleaning up..."
$(CLEAN_CMD)
test:
@echo "Running tests with pytest..."
pytest -s -v --cov --cov-report=term --cov-report=html