forked from rroart/freevms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
232 lines (194 loc) · 6.98 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
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
TOPDIR := $(shell /bin/pwd)
VMSSUBDIRS = crtl starlet librtl smgrtl sort cld cdu msgfil cliutl backup dir init login dcl edt dfu mount copy delete dif util32 sda instal uaf sysman
VMSSUBDIRSINST = crtl starlet librtl smgrtl sort cld cliutl dir dcl login init edt dfu mount copy delete dif util32 sda instal uaf sysman driver
VMSSUBDIRS2 =
VMSSUBDIRS3 = cmuip/ipacp/src/
export BLISS = $(TOPDIR)/bliss/bin/gcc
TMPARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
export LIBGCC = $(shell gcc -print-libgcc-file-name)
export LIBGCC_EH = $(shell gcc -print-file-name=libgcc_eh.a)
export LIBGCC += $(LIBGCC_EH)
# this is only used by exe_ele, which is going away after cleaning
export LIBC = /usr/lib/libc.a
export EXE = .exe
export NOEXE =
export EXE_ELF = .ele
export VMS_RPATH = -Wl,-rpath,/vms"$$$$"common/syslib
export VMS_LD_RPATH = -rpath /vms"$$$$"common/syslib
export VMSLIBS = $(TOPDIR)/librtl/src/librtl.a $(TOPDIR)/starlet/src/starlet.a
export VMSLIBS_PIC = $(TOPDIR)/librtl/src/librtl_pic.a $(TOPDIR)/starlet/src/starlet_pic.a
export VMSDLIBS_EXE = $(TOPDIR)/librtl/src/i386/librtl$(EXE) $(TOPDIR)/starlet/src/i386/starlet$(EXE)
export VMSDLIBS_EXE_ELF = $(TOPDIR)/librtl/src/i386/librtl$(EXE_ELF) $(TOPDIR)/starlet/src/i386/starlet$(EXE_ELF)
export OLDLIBCINCLUDEDIR_I386 = $(TOPDIR)/debian/libc6-dev_2.3.6.ds1-13etch10+b1_i386/usr/include
export OLDLIBCINCLUDEDIR_AMD64 = $(TOPDIR)/debian/libc6-dev_2.3.6.ds1-13etch10_amd64/usr/include
export OLDLIBELFINCLUDEDIR_I386 = $(TOPDIR)/debian/libelfg0-dev_0.8.6-3_i386/usr/include
export OLDLIBELFINCLUDEDIR_AMD64 = $(TOPDIR)/debian/libelfg0-dev_0.8.6-3_amd64/usr/include
export OLDLIBCDIR_I386 = $(TOPDIR)/debian/libc6-dev_2.3.6.ds1-13etch10+b1_i386/usr/lib
export OLDLIBCDIR_AMD64 = $(TOPDIR)/debian/libc6-dev_2.3.6.ds1-13etch10_amd64/usr/lib
export OLDLIBELFDIR_I386 = $(TOPDIR)/debian/libelfg0-dev_0.8.6-3_i386/usr/lib
export OLDLIBELFDIR_AMD64 = $(TOPDIR)/debian/libelfg0-dev_0.8.6-3_amd64/usr/lib
export OLDLIBC_I386 = $(TOPDIR)/debian/libc6-dev_2.3.6.ds1-13etch10+b1_i386/usr/lib/libc.a
export OLDLIBC_AMD64 = $(TOPDIR)/debian/libc6-dev_2.3.6.ds1-13etch10_amd64/usr/lib/libc.a
export OLDLIBDL_I386 = $(TOPDIR)/debian/libc6-dev_2.3.6.ds1-13etch10+b1_i386/usr/lib/libdl.a
export OLDLIBDL_AMD64 = $(TOPDIR)/debian/libc6-dev_2.3.6.ds1-13etch10_amd64/usr/lib/libdl.a
export OLDCRT1_I386 = $(TOPDIR)/debian/libc6-dev_2.3.6.ds1-13etch10+b1_i386/usr/lib/crt1.o
export OLDCRT1_AMD64 = $(TOPDIR)/debian/libc6-dev_2.3.6.ds1-13etch10_amd64/usr/lib/crt1.o
export OLDCRTI_I386 = $(TOPDIR)/debian/libc6-dev_2.3.6.ds1-13etch10+b1_i386/usr/lib/crti.o
export OLDCRTI_AMD64 = $(TOPDIR)/debian/libc6-dev_2.3.6.ds1-13etch10_amd64/usr/lib/crti.o
export OLDCRTN_I386 = $(TOPDIR)/debian/libc6-dev_2.3.6.ds1-13etch10+b1_i386/usr/lib/crtn.o
export OLDCRTN_AMD64 = $(TOPDIR)/debian/libc6-dev_2.3.6.ds1-13etch10_amd64/usr/lib/crtn.o
export OLDLIBELF_I386 = $(TOPDIR)/debian/libelfg0-dev_0.8.6-3_i386/usr/lib/libelf.a
export OLDLIBELF_AMD64 = $(TOPDIR)/debian/libelfg0-dev_0.8.6-3_amd64/usr/lib/libelf.a
export LINKER = $(TOPDIR)/linker/src/linker
SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
ARCH := $(SUBARCH)
export LINKPRE = -Bstatic
#export LINKPRE = -Bstatic -s
# for use with freevms linker, use old libs
ifeq ($(ARCH),i386)
export LINKPOST = $(OLDCRT1_I386) $(OLDCRTI_I386) $(OLDLIBC_I386)
export OLDLIBC = $(OLDLIBC_I386)
export OLDLIBDL = $(OLDLIBDL_I386)
export OLDLIBELF = $(OLDLIBELF_I386)
export OLDLIBCDIR = $(OLDLIBCDIR_I386)
export OLDLIBELFDIR = $(OLDLIBELFDIR_I386)
export OLDLIBELFINCLUDEDIR = $(OLDLIBELFINCLUDEDIR_I386)
#so far only for edt
export OLDLIBCINCLUDEDIR = $(OLDLIBCINCLUDEDIR_I386)
endif
ifeq ($(ARCH),x86_64)
export LINKPOST = $(OLDCRT1_AMD64) $(OLDCRTI_AMD64) $(OLDLIBC_AMD64)
export OLDLIBC = $(OLDLIBC_AMD64)
export OLDLIBDL = $(OLDLIBDL_AMD64)
export OLDLIBELF = $(OLDLIBELF_AMD64)
export OLDLIBCDIR = $(OLDLIBCDIR_AMD64)
export OLDLIBELFDIR = $(OLDLIBELFDIR_AMD64)
export OLDLIBELFINCLUDEDIR = $(OLDLIBELFINCLUDEDIR_AMD64)
export OLDLIBCINCLUDEDIR = $(OLDLIBCINCLUDEDIR_AMD64)
endif
export OLDINCLUDE=-I${OLDLIBCINCLUDEDIR} -I${OLDLIBELFINCLUDEDIR}
export ROOTI386 = $(TOPDIR)/rooti386
export ROOTI386_COMMON = $(TOPDIR)/rooti386/vms"$$$$"common
export ROOTI386_COMMON_SYSEXE = $(TOPDIR)/rooti386/vms"$$$$"common/sysexe
export EXTERNAL = $(TOPDIR)/cdu/src/cdu.a
export EXTERNAL_PIC = $(TOPDIR)/cdu/src/cdu_pic.a
export EXTERNAL2 = $(TOPDIR)/cdu/src/cdu2.a
export EXTERNAL2_PIC = $(TOPDIR)/cdu/src/cdu2_pic.a
#
# standard CFLAGS
#
HPATH = $(TOPDIR)/linux/include
CC := gcc
HOSTCC = gcc
CPPFLAGS := -I$(TOPDIR)/sys/src -I$(TOPDIR)/lib/src -I$(TOPDIR)/librtl/src -I$(TOPDIR)/starlet/src -I$(HPATH) $(OLDINCLUDE)
CFLAGS := -Werror-implicit-function-declaration $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs
#CFLAGS += -fno-builtin-sprintf -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common
CFLAGS += -fdollars-in-identifiers -Wall -Wmissing-prototypes -Wcast-qual -Wconversion -DNOKERNEL
HOSTCFLAGS = -Werror-implicit-function-declaration -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -I$(TOPDIR)/linux/include2
export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \
CONFIG_SHELL TOPDIR HPATH HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \
CPP AR NM STRIP OBJCOPY OBJDUMP MAKE MAKEFILES GENKSYMS MODFLAGS PERL
vmsall:
for X in $(VMSSUBDIRS); do \
cd $$X/src; \
make CFLAGS="$(CFLAGS)"; \
cd ../..; \
done; \
for X in $(VMSSUBDIRS2); do \
cd $$X; \
make CFLAGS="$(CFLAGS)"; \
cd ..; \
done; \
for X in $(VMSSUBDIRS3); do \
cd $$X; \
make CFLAGS="$(CFLAGS)"; \
cd ../../..; \
done;
vmsclean:
for X in $(VMSSUBDIRS); do \
cd $$X/src; \
make clean; \
cd ../..; \
done; \
for X in $(VMSSUBDIRS2); do \
cd $$X; \
make clean; \
cd ..; \
done; \
for X in $(VMSSUBDIRS3); do \
cd $$X; \
make clean; \
cd ../../..; \
done;
rootinstall:
for X in $(VMSSUBDIRSINST); do \
cd $$X/src; \
make install; \
cd ../..; \
done; \
for X in $(VMSSUBDIRS2); do \
cd $$X; \
make install; \
cd ..; \
done; \
for X in $(VMSSUBDIRS3); do \
cd $$X; \
make install; \
cd ../../..; \
done; \
# make -f Makefile.linux install
image-install:
make rootinstall; \
cd diskimage; \
./instmnt; \
cd ..
image:
cd diskimage; \
make image; \
cd ..
image-kernel-iomm:
cd diskimage; \
make image-kernel-iomm; \
cd ..
vbimage:
cd diskimage; \
make vbimage; \
cd ..
createvb:
cd createvb; \
make vbimage; \
cd ..
environment:
./envscript
download-linker:
cd linker/src; \
make download-linker; \
cd ../..
build-linker:
cd linker/src; \
make build-linker; \
cd ../..
download-bliss:
cd bliss/src; \
make download-bliss; \
cd ../..
build-bliss:
cd bliss/src; \
make build-bliss; \
cd ../..
download-grub:
cd grub/src; \
make download-grub; \
cd ../..
build-grub:
cd grub/src; \
make build-grub; \
cd ../..
telnet:
cd cmuip/telnet/src; \
make; \
cd ../../..
doxygen:
doxygen doc/doxygen.conf
bzImage:
make -f Makefile.kernel bzImage