# Makefile.winnt for coLinux (mingw32)

# Host System operating system
export COLINUX_HOST_OS := winnt

# Host System architecture
export COLINUX_HOST_ARCH := $(shell . $(USER_CFG); echo $$COLINUX_HOST_ARCH)

# Host system variables and directories
export PREFIX := $(shell . $(USER_CFG); echo $$PREFIX)

# Need some variables and PATH of cross compiler in make.
export PATH := $(PATH):$(PREFIX)/bin

.PHONY: all cross cross libs kernel download package installer
all: cross libs kernel colinux

#
# Check tools and targets via md5sum
#

cross:
	@cd bin && ./build-cross.sh

libs:
	@cd bin && ./build-colinux-libs.sh

kernel:
	@cd bin && ./build-kernel.sh

# Download only all missing sources (for cross compile)
download:
	@cd bin && ./build-all.sh --download-only

# Create a pre-distributabel package as ZIP
package: src/colinux/os/winnt/build/linux.sys
	@cd bin && ./premaid.sh --update
	@. bin/build-common.sh ; build_package

# Create installer (need wine and running X11)
installer: src/colinux/os/winnt/build/linux.sys
	@cd bin && ./premaid.sh --update
	@cd src && make installer
