9db62776a42166f67695aa61aedd383ee1af48a7
[reactos.git] / freeldr / freeldr / cache / Makefile
1 #
2 # FreeLoader
3 # Copyright (C) 1999, 2000, 2001 Brian Palmer <brianp@sginet.com>
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 #
19
20
21 export CC = gcc
22 export LD = ld
23 export AR = ar
24 export RM = cmd /C del
25 export CP = cmd /C copy
26
27 #FLAGS = -Wall -nostdinc -fno-builtin
28 FLAGS = -Wall -fno-builtin -DDEBUG -O3
29 #FLAGS = -Wall -fno-builtin
30
31 # asmcode.o has to be first in the link line because it contains the startup code
32 #OBJS = asmcode.a asmcode.o mb.o boot.o freeldr.o stdlib.o fs.a fs.o fat.o \
33 # reactos.o tui.o menu.o miscboot.o options.o linux.o multiboot.o arcname.o \
34 # mem.o memory.o debug.o parseini.o registry.o import.o
35 ASM_OBJS = asmcode.o mb.o boot.o mem.o
36 C_OBJS = freeldr.o stdlib.o fs.a tui.o menu.o miscboot.o options.o linux.o multiboot.o \
37 reactos/reactos.o reactos/registry.o reactos/reghive.o reactos/hwdetect.o
38 C_OBJS2 = arcname.o memory.o debug.o parseini.o rs232.o portio.o oslist.o
39
40 .PHONY : clean
41
42 all: freeldr.sys
43
44 freeldr.sys: asmcode.a c_code.a
45 $(LD) -N -Ttext=0x8000 --oformat=binary -s -o f.sys asmcode.a c_code.a
46 ../bootsect/stubit ../bootsect/fatstub.bin f.sys freeldr.sys
47
48 freeldr.exe: asmcode.a c_code.a
49 $(LD) -o freeldr.exe asmcode.a c_code.a
50
51 asmcode.a: $(ASM_OBJS)
52 $(LD) -r -o asmcode.a $(ASM_OBJS)
53
54 c_code.a: c_code1.a c_code2.a
55 $(LD) -r -o c_code.a c_code1.a c_code2.a
56
57 c_code1.a: $(C_OBJS)
58 $(LD) -r -o c_code1.a $(C_OBJS)
59
60 c_code2.a: $(C_OBJS2)
61 $(LD) -r -o c_code2.a $(C_OBJS2)
62
63 asmcode.o: asmcode.S asmcode.h Makefile
64 $(CC) $(FLAGS) -o asmcode.o -c asmcode.S
65
66 freeldr.o: freeldr.c freeldr.h stdlib.h fs.h reactos/reactos.h tui.h asmcode.h menu.h miscboot.h Makefile
67 $(CC) $(FLAGS) -o freeldr.o -c freeldr.c
68
69 stdlib.o: stdlib.c freeldr.h stdlib.h Makefile
70 $(CC) $(FLAGS) -o stdlib.o -c stdlib.c
71
72 fs.a: fs.o fat.o Makefile
73 $(LD) -r -o fs.a fs.o fat.o
74
75 fs.o: fs.c freeldr.h fs.h stdlib.h tui.h asmcode.h Makefile
76 $(CC) $(FLAGS) -o fs.o -c fs.c
77
78 fat.o: fat.c fat.h freeldr.h fs.h stdlib.h tui.h Makefile
79 $(CC) $(FLAGS) -o fat.o -c fat.c
80
81 reactos/reactos.o: reactos/reactos.c freeldr.h reactos/reactos.h reactos/registry.h reactos/hwdetect.h stdlib.h fs.h tui.h multiboot.h Makefile
82 $(CC) $(FLAGS) -o reactos/reactos.o -c reactos/reactos.c
83
84 multiboot.o: multiboot.c freeldr.h stdlib.h fs.h multiboot.h tui.h Makefile
85 $(CC) $(FLAGS) -o multiboot.o -c multiboot.c
86
87 mb.o: mb.S asmcode.h multiboot.h Makefile
88 $(CC) $(FLAGS) -o mb.o -c mb.S
89
90 tui.o: tui.c freeldr.h stdlib.h tui.h Makefile
91 $(CC) $(FLAGS) -o tui.o -c tui.c
92
93 menu.o: menu.c freeldr.h stdlib.h tui.h menu.h Makefile
94 $(CC) $(FLAGS) -o menu.o -c menu.c
95
96 boot.o: boot.S asmcode.h Makefile
97 $(CC) $(FLAGS) -o boot.o -c boot.S
98
99 miscboot.o: miscboot.c freeldr.h asmcode.h stdlib.h fs.h tui.h miscboot.h Makefile
100 $(CC) $(FLAGS) -o miscboot.o -c miscboot.c
101
102 options.o: options.c freeldr.h stdlib.h tui.h options.h Makefile
103 $(CC) $(FLAGS) -o options.o -c options.c
104
105 linux.o: linux.c freeldr.h stdlib.h tui.h linux.h Makefile
106 $(CC) $(FLAGS) -o linux.o -c linux.c
107
108 arcname.o: arcname.c freeldr.h arcname.h stdlib.h Makefile
109 $(CC) $(FLAGS) -o arcname.o -c arcname.c
110
111 mem.o: mem.S asmcode.h Makefile
112 $(CC) $(FLAGS) -o mem.o -c mem.S
113
114 memory.o: memory.c memory.h Makefile
115 $(CC) $(FLAGS) -o memory.o -c memory.c
116
117 debug.o: debug.c debug.h Makefile
118 $(CC) $(FLAGS) -o debug.o -c debug.c
119
120 parseini.o: parseini.c parseini.h Makefile
121 $(CC) $(FLAGS) -o parseini.o -c parseini.c
122
123 rs232.o: rs232.c rs232.h Makefile
124 $(CC) $(FLAGS) -o rs232.o -c rs232.c
125
126 portio.o: portio.c portio.h Makefile
127 $(CC) $(FLAGS) -o portio.o -c portio.c
128
129 oslist.o: oslist.c oslist.h Makefile
130 $(CC) $(FLAGS) -o oslist.o -c oslist.c
131
132 reactos/registry.o: reactos/registry.c freeldr.h memory.h reactos/registry.h stdlib.h Makefile
133 $(CC) $(FLAGS) -o reactos/registry.o -c reactos/registry.c
134
135 reactos/reghive.o: reactos/reghive.c freeldr.h reactos/registry.h stdlib.h memory.h Makefile
136 $(CC) $(FLAGS) -o reactos/reghive.o -c reactos/reghive.c
137
138 reactos/hwdetect.o: reactos/hwdetect.c freeldr.h reactos/hwdetect.h Makefile
139 $(CC) $(FLAGS) -o reactos/hwdetect.o -c reactos/hwdetect.c
140
141 clean:
142 $(RM) *.o
143 $(RM) *.a
144 $(RM) *.sys