2015-02-01 10:16:25 +01:00
|
|
|
#
|
|
|
|
# Copyright 2011-2014 Branimir Karadzic. All rights reserved.
|
|
|
|
# License: http://www.opensource.org/licenses/BSD-2-Clause
|
|
|
|
#
|
|
|
|
|
|
|
|
UNAME := $(shell uname)
|
2016-07-26 01:34:49 +02:00
|
|
|
ifeq ($(UNAME),$(filter $(UNAME),Linux Darwin SunOS FreeBSD GNU/kFreeBSD NetBSD OpenBSD GNU))
|
2015-02-01 10:16:25 +01:00
|
|
|
ifeq ($(UNAME),$(filter $(UNAME),Darwin))
|
|
|
|
OS=darwin
|
|
|
|
else
|
2015-04-10 12:37:34 +02:00
|
|
|
ifeq ($(UNAME),$(filter $(UNAME),SunOS))
|
|
|
|
OS=solaris
|
|
|
|
else
|
|
|
|
ifeq ($(UNAME),$(filter $(UNAME),FreeBSD GNU/kFreeBSD NetBSD OpenBSD))
|
|
|
|
OS=bsd
|
|
|
|
else
|
2015-02-01 10:16:25 +01:00
|
|
|
OS=linux
|
|
|
|
endif
|
2015-04-10 12:37:34 +02:00
|
|
|
endif
|
|
|
|
endif
|
2015-02-01 10:16:25 +01:00
|
|
|
else
|
|
|
|
OS=windows
|
|
|
|
endif
|
|
|
|
|
|
|
|
.PHONY: release
|
|
|
|
|
|
|
|
GENIE=bin/$(OS)/genie
|
2020-02-05 23:21:10 +01:00
|
|
|
PROJECT_TYPE?=gmake
|
2015-02-01 10:16:25 +01:00
|
|
|
|
|
|
|
SILENT?=@
|
|
|
|
|
|
|
|
$(GENIE):
|
2020-02-05 23:21:10 +01:00
|
|
|
$(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).$(OS)
|
2015-02-01 10:16:25 +01:00
|
|
|
|
2016-06-08 19:36:57 +02:00
|
|
|
all: $(SILENT) $(GENIE)
|
2015-02-01 10:16:25 +01:00
|
|
|
|
|
|
|
clean:
|
2020-02-05 23:21:10 +01:00
|
|
|
$(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).$(OS) clean
|
2015-02-01 10:16:25 +01:00
|
|
|
$(SILENT) -rm -rf bin
|
|
|
|
|
2016-06-08 19:36:57 +02:00
|
|
|
projgen:
|
2020-02-05 23:21:10 +01:00
|
|
|
$(SILENT) $(GENIE) --to=../build/$(PROJECT_TYPE).windows --os=windows $(PROJECT_TYPE)
|
|
|
|
$(SILENT) $(GENIE) --to=../build/$(PROJECT_TYPE).linux --os=linux $(PROJECT_TYPE)
|
|
|
|
$(SILENT) $(GENIE) --to=../build/$(PROJECT_TYPE).darwin --os=macosx --platform=universal32 $(PROJECT_TYPE)
|
|
|
|
$(SILENT) $(GENIE) --to=../build/$(PROJECT_TYPE).freebsd --os=bsd $(PROJECT_TYPE)
|
2016-06-08 19:36:57 +02:00
|
|
|
|
2015-02-01 10:16:25 +01:00
|
|
|
rebuild:
|
2020-02-05 23:21:10 +01:00
|
|
|
$(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).$(OS) clean all
|
2015-02-01 10:16:25 +01:00
|
|
|
|
|
|
|
release-windows release-darwin: $(GENIE)
|
|
|
|
$(GENIE) release
|
2020-02-05 23:21:10 +01:00
|
|
|
$(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).$(OS) clean all
|
2015-02-01 10:16:25 +01:00
|
|
|
$(SILENT) git checkout src/host/version.h
|
|
|
|
|
|
|
|
release-linux: $(GENIE)
|
|
|
|
$(SILENT) $(GENIE) release
|
2020-02-05 23:21:10 +01:00
|
|
|
$(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).darwin clean all CC=x86_64-apple-darwin15-clang
|
|
|
|
$(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).linux clean all
|
|
|
|
$(SILENT) $(MAKE) -C build/$(PROJECT_TYPE).windows clean all CC=x86_64-w64-mingw32-gcc
|
2015-02-01 10:16:25 +01:00
|
|
|
$(SILENT) git checkout src/host/version.h
|
|
|
|
|
|
|
|
release: release-$(OS)
|
2015-03-17 11:08:12 +01:00
|
|
|
|
|
|
|
dist: release
|
|
|
|
cp bin/linux/genie ../bx/tools/bin/linux/
|
|
|
|
cp bin/windows/genie.exe ../bx/tools/bin/windows/
|
|
|
|
cp bin/darwin/genie ../bx/tools/bin/darwin/
|