File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -49,28 +49,37 @@ INSTALL ?= /usr/bin/install
49
49
MOLINILLO_VERSION = $(shell $(CRYSTAL ) eval 'require "yaml"; puts YAML.parse(File.read("shard.lock") )["shards"]["molinillo"]["version"]')
50
50
MOLINILLO_URL = "https://github.com/crystal-lang/crystal-molinillo/archive/v$(MOLINILLO_VERSION ) .tar.gz"
51
51
52
+ # MSYS2 support (native Windows should use `Makefile.win` instead)
53
+ ifeq ($(OS ) ,Windows_NT)
54
+ EXE := .exe
55
+ WINDOWS := 1
56
+ else
57
+ EXE :=
58
+ WINDOWS :=
59
+ endif
60
+
52
61
.PHONY : all
53
62
all : build
54
63
55
64
include docs.mk
56
65
57
66
.PHONY : build
58
- build : bin/shards
67
+ build : bin/shards$( EXE )
59
68
60
69
.PHONY : clean
61
70
clean : # # Remove build artifacts
62
71
clean : clean_docs
63
- rm -f bin/shards
72
+ rm -f bin/shards$( EXE )
64
73
65
- bin/shards : $(SOURCES ) $(TEMPLATES ) lib
74
+ bin/shards$( EXE ) : $(SOURCES ) $(TEMPLATES ) lib
66
75
@mkdir -p bin
67
- $(EXPORTS ) $(CRYSTAL ) build $(FLAGS ) src/shards.cr -o bin/shards
76
+ $(EXPORTS ) $(CRYSTAL ) build $(FLAGS ) src/shards.cr -o " $@ "
68
77
69
78
.PHONY : install
70
79
install : # # Install shards
71
- install : bin/shards man/shards.1.gz man/shard.yml.5.gz
80
+ install : bin/shards$( EXE ) man/shards.1.gz man/shard.yml.5.gz
72
81
$(INSTALL ) -m 0755 -d " $( BINDIR) " " $( MANDIR) /man1" " $( MANDIR) /man5"
73
- $(INSTALL ) -m 0755 bin/shards " $( BINDIR) "
82
+ $(INSTALL ) -m 0755 bin/shards$( EXE ) " $( BINDIR) "
74
83
$(INSTALL ) -m 0644 man/shards.1.gz " $( MANDIR) /man1"
75
84
$(INSTALL ) -m 0644 man/shard.yml.5.gz " $( MANDIR) /man5"
76
85
@@ -92,7 +101,7 @@ test_unit: lib
92
101
93
102
.PHONY : test_integration
94
103
test_integration : # # Run integration tests
95
- test_integration : bin/shards
104
+ test_integration : bin/shards$( EXE )
96
105
$(CRYSTAL ) spec ./spec/integration/
97
106
98
107
lib : shard.lock
You can’t perform that action at this time.
0 commit comments