aboutsummaryrefslogtreecommitdiff
path: root/mingw.bld
blob: dafb73d8d8b5dc3b5b155fd15142df1bde62d018 (plain)
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
67
68
69
70
71
72
73
/**
 * This is the default.bld file for libgats, it pretty much handles everything
 * libgats related, kinda' cool, eh?  It can completely replace the old build
 * and actually does a better job with a number of things.
 */

CXXFLAGS += "-ggdb -W -Wall";

action "default"
{
	build: [targets("header-links"), "libgatswin.a"];
}

target files("src/*.h").replace("src/", "gats/")
{
	tag "header-links";
	display "symlink";
	input OUTPUT.replace("gats/","src/");
	profile "build"
	{
		execute("mkdir -p $(dirname ${OUTPUT}); ln -s ../${INPUT} ${OUTPUT}");
	}
}
target files("src/compat/*.h").replace("src/", "gats/")
{
	tag "header-links";
	display "symlink";
	input OUTPUT.replace("gats/","src/");
	profile "build"
	{
		execute("mkdir -p $(dirname ${OUTPUT}); ln -s ../../${INPUT} ${OUTPUT}");
	}
}

target "libgatswin.a"
{
	input files("src/*.cpp");
	rule "lib";
	CXXFLAGS += "-I. -Ilibbu++";
}

function cppToWinObj()
{
	if OBJ_DIR == null then
	{
		return INPUT.regex("\\.cpp$", ".win_o");
	}
	else
	{
		return OBJ_DIR + "/" + INPUT.fileName().regex("\\.cpp$", ".win_o");
	}

}

rule "lib"
{
	input "*.win_o";
	profile "build"
	{
		execute("wine C:/MinGW/bin/ar.exe cr ${OUTPUT} ${INPUT}");
	}
}

rule "wincpp"
{
	input "*.cpp";
	output INPUT.cppToWinObj();
	//requires getMakeDeps("wine C:/MinGW/bin/g++.exe ${CXXFLAGS} -M ${INPUT}");
	profile "build"
	{
		execute("wine C:/MinGW/bin/g++.exe ${CXXFLAGS} -c -o ${OUTPUT} ${INPUT}", "g++");
	}
}