forked from bkaradzic/GENie
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
66 lines (53 loc) · 1.66 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#
# Copyright 2011-2014 Branimir Karadzic. All rights reserved.
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
UNAME := $(shell uname)
ifeq ($(UNAME),$(filter $(UNAME),Linux Darwin SunOS FreeBSD GNU/kFreeBSD NetBSD OpenBSD GNU))
ifeq ($(UNAME),$(filter $(UNAME),Darwin))
OS=darwin
else
ifeq ($(UNAME),$(filter $(UNAME),SunOS))
OS=solaris
else
ifeq ($(UNAME),$(filter $(UNAME),FreeBSD GNU/kFreeBSD NetBSD OpenBSD))
OS=bsd
else
OS=linux
endif
endif
endif
else
OS=windows
endif
.PHONY: release
GENIE=bin/$(OS)/genie
SILENT?=@
$(GENIE):
$(SILENT) $(MAKE) -C build/gmake.$(OS)
all: $(SILENT) $(GENIE)
clean:
$(SILENT) $(MAKE) -C build/gmake.$(OS) clean
$(SILENT) -rm -rf bin
projgen:
$(SILENT) $(GENIE) --to=../build/gmake.windows --os=windows gmake
$(SILENT) $(GENIE) --to=../build/gmake.linux --os=linux gmake
$(SILENT) $(GENIE) --to=../build/gmake.darwin --os=macosx --platform=universal32 gmake
$(SILENT) $(GENIE) --to=../build/gmake.freebsd --os=bsd gmake
rebuild:
$(SILENT) $(MAKE) -C build/gmake.$(OS) clean all
release-windows release-darwin: $(GENIE)
$(GENIE) release
$(SILENT) $(MAKE) -C build/gmake.$(OS) clean all
$(SILENT) git checkout src/host/version.h
release-linux: $(GENIE)
$(SILENT) $(GENIE) release
$(SILENT) $(MAKE) -C build/gmake.darwin clean all CC=x86_64-apple-darwin15-clang
$(SILENT) $(MAKE) -C build/gmake.linux clean all
$(SILENT) $(MAKE) -C build/gmake.windows clean all CC=i686-w64-mingw32-gcc
$(SILENT) git checkout src/host/version.h
release: release-$(OS)
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/