niminst/makefile: add windows support (#11380)
This commit is contained in:
parent
5eb47f8ed9
commit
06f251fe4e
1 changed files with 12 additions and 2 deletions
|
|
@ -15,8 +15,14 @@ ifeq ($(koch),yes)
|
||||||
binDir = ../bin
|
binDir = ../bin
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
target := ?{"$(binDir)/" & toLowerAscii(c.name)}
|
||||||
|
|
||||||
ucpu := $(shell sh -c 'uname -m | tr "[:upper:]" "[:lower:]"')
|
ucpu := $(shell sh -c 'uname -m | tr "[:upper:]" "[:lower:]"')
|
||||||
uos := $(shell sh -c 'uname | tr "[:upper:]" "[:lower:]"')
|
ifeq ($(OS),Windows_NT)
|
||||||
|
uos := windows
|
||||||
|
else
|
||||||
|
uos := $(shell sh -c 'uname | tr "[:upper:]" "[:lower:]"')
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(uos),linux)
|
ifeq ($(uos),linux)
|
||||||
myos = linux
|
myos = linux
|
||||||
|
|
@ -64,6 +70,10 @@ endif
|
||||||
ifeq ($(uos),haiku)
|
ifeq ($(uos),haiku)
|
||||||
myos = haiku
|
myos = haiku
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(uos),windows)
|
||||||
|
myos = windows
|
||||||
|
target := $(target).exe
|
||||||
|
endif
|
||||||
ifndef myos
|
ifndef myos
|
||||||
$(error unknown operating system: $(uos))
|
$(error unknown operating system: $(uos))
|
||||||
endif
|
endif
|
||||||
|
|
@ -169,7 +179,7 @@ ifeq ($(strip $(oFiles)),)
|
||||||
$(error no C code generated for: [$(myos): $(mycpu)])
|
$(error no C code generated for: [$(myos): $(mycpu)])
|
||||||
endif
|
endif
|
||||||
|
|
||||||
?{"$(binDir)/" & toLowerAscii(c.name)}: $(oFiles)
|
$(target): $(oFiles)
|
||||||
@mkdir -p $(binDir)
|
@mkdir -p $(binDir)
|
||||||
$(LD) -o $@ $^ $(LDFLAGS)
|
$(LD) -o $@ $^ $(LDFLAGS)
|
||||||
@echo "SUCCESS"
|
@echo "SUCCESS"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue