Rename .lilo extension to .lkrn and updated dependencies
[gpxe.git] / src / arch / i386 / Makefile
blobbda22c8af66481de1bde48ce5b4b8097bf2d3369
1 # Locations of utilities
3 ISOLINUX_BIN = /usr/lib/syslinux/isolinux.bin
5 # i386-specific directories containing source files
7 SRCDIRS += arch/i386/core arch/i386/transitions arch/i386/prefix
8 SRCDIRS += arch/i386/firmware/pcbios
9 SRCDIRS += arch/i386/image
10 SRCDIRS += arch/i386/drivers/bus
11 SRCDIRS += arch/i386/drivers/net
12 SRCDIRS += arch/i386/drivers/disk
13 SRCDIRS += arch/i386/interface/pcbios
14 SRCDIRS += arch/i386/interface/pxe
16 # The various xxx_loader.c files are #included into core/loader.c and
17 # should not be compiled directly.
19 NON_AUTO_SRCS += arch/i386/core/aout_loader.c
20 NON_AUTO_SRCS += arch/i386/core/freebsd_loader.c
21 NON_AUTO_SRCS += arch/i386/core/wince_loader.c
23 # unnrv2b.S is used to generate a 16-bit as well as a 32-bit object.
25 OBJS_unnrv2b = unnrv2b unnrv2b16
26 CFLAGS_unnrv2b16 = -DCODE16
28 # We need to undefine the default macro "i386" when compiling .S
29 # files, otherwise ".arch i386" translates to ".arch 1"...
31 CFLAGS_S += -Ui386
33 # The i386 linker script
35 LDSCRIPT = arch/i386/scripts/i386.lds
37 # Media types.
39 # It's ugly that we have to define these repetitive combinations by
40 # hand. Unforunately, $(eval ...) is available only in make >= 3.80,
41 # and using an external Makefile fragment doesn't work because
42 # OBJS_xxx need to be defined *before* the external Makefile fragments
43 # for the source files are generated...
45 CFLAGS_ZPREFIX = -DCOMPRESS
47 MEDIA += rom
48 OBJS_romprefix = romprefix zromprefix
49 CFLAGS_zromprefix = $(CFLAGS_ZPREFIX)
51 MEDIA += pxe
52 OBJS_pxeprefix = pxeprefix zpxeprefix
53 CFLAGS_zpxeprefix = $(CFLAGS_ZPREFIX)
55 MEDIA += elf
56 OBJS_elfprefix = elfprefix zelfprefix
57 CFLAGS_zelfprefix = $(CFLAGS_ZPREFIX)
59 MEDIA += elfd
60 OBJS_elfdprefix = elfdprefix zelfdprefix
61 CFLAGS_zelfdprefix = $(CFLAGS_ZPREFIX)
63 MEDIA += lmelf
64 OBJS_lmelfprefix = lmelfprefix zlmelfprefix
65 CFLAGS_zlmelfprefix = $(CFLAGS_ZPREFIX)
67 MEDIA += lmelfd
68 OBJS_lmelfdprefix = lmelfdprefix zlmelfdprefix
69 CFLAGS_zlmelfdprefix = $(CFLAGS_ZPREFIX)
71 MEDIA += lkrn
72 OBJS_lkrnprefix = lkrnprefix zlkrnprefix
73 CFLAGS_zlkrnprefix = $(CFLAGS_ZPREFIX)
75 MEDIA += bImage
76 OBJS_bImageprefix = bImageprefix zbImageprefix
77 CFLAGS_zbImageprefix = $(CFLAGS_ZPREFIX)
79 MEDIA += dsk
80 OBJS_dskprefix = dskprefix zdskprefix
81 CFLAGS_zdskprefix = $(CFLAGS_ZPREFIX)
83 MEDIA += nbi
84 OBJS_nbiprefix = nbiprefix znbiprefix
85 CFLAGS_znbiprefix = $(CFLAGS_ZPREFIX)
87 MEDIA += hd
88 OBJS_hdprefix = hdprefix zhdprefix
89 CFLAGS_zhdprefix = $(CFLAGS_ZPREFIX)
91 MEDIA += raw
92 OBJS_rawprefix = rawprefix zrawprefix
93 CFLAGS_zrawprefix = $(CFLAGS_ZPREFIX)
95 # These media cannot handle compressed payloads
97 MEDIA += com
99 MEDIA += exe
101 # Special target for building Master Boot Record binary
102 $(BIN)/mbr.bin : $(BIN)/mbr.o
103 $(OBJCOPY) -O binary $< $@
105 # Some suffixes (e.g. %.zfd0) are generated directly from other
106 # finished files (e.g. %.zdsk), rather than having their own prefix.
108 # rule to write disk images to /dev/fd0
109 NON_AUTO_MEDIA += fd0
110 %fd0 : %dsk
111 dd if=$< bs=512 conv=sync of=/dev/fd0
112 sync
114 # rule to make a non-emulation ISO boot image
115 NON_AUTO_MEDIA += iso
116 %iso: %lkrn util/geniso
117 ISOLINUX_BIN=$(ISOLINUX_BIN) bash util/geniso $@ $<
119 # rule to make a floppy emulation ISO boot image
120 NON_AUTO_MEDIA += liso
121 %liso: %lkrn util/genliso
122 bash util/genliso $@ $<
124 # rule to make a USB disk image
125 $(BIN)/usbdisk.bin : $(BIN)/usbdisk.o
126 $(OBJCOPY) -O binary $< $@
128 %usb: $(BIN)/usbdisk.bin %hd
129 cat $^ > $@
131 # Add NON_AUTO_MEDIA to the media list, so that they show up in the
132 # output of "make"
134 MEDIA += $(NON_AUTO_MEDIA)
136 # Shortcut to allow typing just
137 # make bin-kir/%
138 # rather than
139 # make -f arch/i386/kir-Makefile bin-kir/%
140 # for building a KEEP_IT_REAL flavour.
142 $(BIN)-kir/% : kir-target
143 $(MAKE) -f arch/i386/kir-Makefile $(MAKECMDGOALS)
145 .PHONY : kir-target