summaryrefslogtreecommitdiff
path: root/src/lib9/Makefile
blob: a10d7730aab7b5f2bbc3bb77c79d8d54e92fd0d6 (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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# Copyright 2009 The Go Authors.  All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

include ../Make.inc
O:=$(HOST_O)

LIB=lib9.a

NUM=\
	charstod.$O\
	pow10.$O\

# Could add fmt/errfmt, but we want to pick it up from ./errstr.c instead.
FMTOFILES=\
	dofmt.$O\
	fltfmt.$O\
	fmt.$O\
	fmtfd.$O\
	fmtfdflush.$O\
	fmtlocale.$O\
	fmtlock2.$O\
	fmtnull.$O\
	fmtprint.$O\
	fmtquote.$O\
	fmtrune.$O\
	fmtstr.$O\
	fmtvprint.$O\
	fprint.$O\
	nan64.$O\
	print.$O\
	seprint.$O\
	smprint.$O\
	snprint.$O\
	sprint.$O\
	strtod.$O\
	vfprint.$O\
	vseprint.$O\
	vsmprint.$O\
	vsnprint.$O\
	$(NUM)\

UTFOFILES=\
	rune.$O\
	utfecpy.$O\
	utflen.$O\
	utfnlen.$O\
	utfrrune.$O\
	utfrune.$O\
	utfutf.$O\
	runetype.$O\

LIB9OFILES=\
	_p9dir.$O\
	_exits.$O\
	argv0.$O\
	atoi.$O\
	cleanname.$O\
	create.$O\
	dirfstat.$O\
	dirfwstat.$O\
	dirstat.$O\
	dirwstat.$O\
	dup.$O\
	errstr.$O\
	exec.$O\
	execl.$O\
	exitcode.$O\
	exits.$O\
	getenv.$O\
	getfields.$O\
	getwd.$O\
	goos.$O\
	main.$O\
	nan.$O\
	nulldir.$O\
	open.$O\
	readn.$O\
	seek.$O\
	strecpy.$O\
	sysfatal.$O\
	time.$O\
	tokenize.$O\

ifeq ($(GOOS),windows)
LIB9OFILES+=\
	win32.$O\

else
LIB9OFILES+=\
	await.$O\
	getuser.$O\
	jmp.$O\
	notify.$O\
	rfork.$O\

endif

OFILES=\
	$(LIB9OFILES)\
	$(FMTOFILES)\
	$(UTFOFILES)\

HFILES=\
	$(QUOTED_GOROOT)/include/u.h\
	$(QUOTED_GOROOT)/include/libc.h\

include ../Make.clib

GOROOT_FINAL?=$(GOROOT)

%.$O: fmt/%.c
	$(HOST_CC) -c $(HOST_CFLAGS) -DPLAN9PORT -Ifmt $<

%.$O: utf/%.c
	$(HOST_CC) -c $(HOST_CFLAGS) $<

goos.$O: goos.c
	$(HOST_CC) -c $(HOST_CFLAGS) -DGOOS='"$(GOOS)"' -DGOARCH='"$(GOARCH)"' -DGOROOT='"$(GOROOT_FINAL)"' -DGOVERSION='"'"$$(../version.bash)"'"' $<