Merging upstream version 5.01+dfsg.
[syslinux-debian/hramrach.git] / com32 / lib / Makefile
blob49a3aafe2ce473bd01114fc2361d658915ad7956
2 # ONLY INCLUDE MIT OR 2/3-BSD-LICENSED CODE IN THIS LIBRARY
5 # Include configuration rules
6 NOGPL := 1
7 topdir = ../../
8 MAKEDIR = $(topdir)/mk
9 include $(MAKEDIR)/lib.mk
11 ## OPTIONAL OBJECTS, AVAILABLE AS DYNAMIC LINKED MODULES
12 # PNG library object files
13 LIBPNG_OBJS = \
14 libpng/png.o libpng/pngset.o libpng/pngget.o libpng/pngrutil.o \
15 libpng/pngtrans.o libpng/pngwutil.o libpng/pngread.o \
16 libpng/pngrio.o libpng/pngwio.o libpng/pngwrite.o \
17 libpng/pngrtran.o libpng/pngwtran.o libpng/pngmem.o \
18 libpng/pngerror.o libpng/pngpread.o
20 # ZIP library object files
21 LIBZLIB_OBJS = \
22 zlib/adler32.o zlib/compress.o zlib/crc32.o \
23 zlib/uncompr.o zlib/deflate.o zlib/trees.o zlib/zutil.o \
24 zlib/inflate.o zlib/infback.o zlib/inftrees.o zlib/inffast.o \
25 sys/zfile.o sys/zfopen.o
27 # JPG library object files
28 LIBJPG_OBJS = \
29 jpeg/tinyjpeg.o jpeg/jidctflt.o jpeg/decode1.o jpeg/decode3.o \
30 jpeg/rgb24.o jpeg/bgr24.o jpeg/yuv420p.o jpeg/grey.o \
31 jpeg/rgba32.o jpeg/bgra32.o
33 LIBVESA_OBJS = \
34 sys/vesacon_write.o sys/vesaserial_write.o \
35 sys/vesa/initvesa.o sys/vesa/drawtxt.o sys/vesa/background.o \
36 sys/vesa/alphatbl.o sys/vesa/screencpy.o sys/vesa/fmtpixel.o \
37 sys/vesa/i915resolution.o
39 LIBMISC_OBJS = \
40 sys/libansi.o sys/gpxe.o
42 LIBPCI_OBJS = \
43 pci/cfgtype.o pci/scan.o pci/bios.o \
44 pci/readb.o pci/readw.o pci/readl.o \
45 pci/writeb.o pci/writew.o pci/writel.o
47 LIBSYSLINUX_OBJS = \
48 syslinux/reboot.o syslinux/keyboard.o \
49 syslinux/version.o \
50 syslinux/pxe_get_cached.o syslinux/pxe_get_nic.o \
51 syslinux/pxe_dns.o \
52 syslinux/video/fontquery.o syslinux/video/reportmode.o
54 LIBLOAD_OBJS = \
55 syslinux/addlist.o syslinux/freelist.o syslinux/memmap.o \
56 syslinux/movebits.o syslinux/shuffle.o syslinux/shuffle_pm.o \
57 syslinux/shuffle_rm.o syslinux/zonelist.o \
58 syslinux/dump_mmap.o syslinux/dump_movelist.o \
60 syslinux/run_default.o syslinux/run_command.o \
61 syslinux/cleanup.o syslinux/localboot.o syslinux/runimage.o \
63 syslinux/loadfile.o syslinux/floadfile.o syslinux/zloadfile.o \
65 syslinux/load_linux.o syslinux/initramfs.o \
66 syslinux/initramfs_file.o syslinux/initramfs_loadfile.o \
67 syslinux/initramfs_archive.o
69 DYNENTRY_OBJS = \
70 atexit.o onexit.o abort.o
72 ## CORE OBJECTS, INCLUDED IN THE ROOT COM32 MODULE
73 LIBENTRY_OBJS = \
74 sys/intcall.o sys/farcall.o sys/cfarcall.o sys/zeroregs.o \
75 sys/argv.o sys/sleep.o \
76 sys/fileinfo.o sys/opendev.o sys/read.o sys/write.o sys/ftell.o \
77 sys/close.o sys/open.o sys/fileread.o sys/fileclose.o \
78 sys/openmem.o \
79 sys/isatty.o sys/fstat.o \
81 dprintf.o vdprintf.o \
83 syslinux/idle.o \
85 exit.o
87 LIBMODULE_OBJS = \
88 sys/module/common.o sys/module/elf_module.o \
89 sys/module/elfutils.o \
90 sys/module/exec.o
92 LIBGCC_OBJS = \
93 libgcc/__ashldi3.o libgcc/__udivdi3.o \
94 libgcc/__negdi2.o libgcc/__ashrdi3.o libgcc/__lshrdi3.o \
95 libgcc/__muldi3.o libgcc/__udivmoddi4.o libgcc/__umoddi3.o \
96 libgcc/__divdi3.o libgcc/__moddi3.o
98 LIBCONSOLE_OBJS = \
100 sys/openconsole.o sys/line_input.o \
101 sys/colortable.o sys/screensize.o \
103 sys/stdcon_read.o sys/rawcon_read.o \
104 sys/rawcon_write.o \
105 sys/null_write.o sys/serial_write.o \
107 sys/xserial_write.o \
109 sys/ansi.o \
111 sys/ansicon_write.o sys/ansiserial_write.o \
113 syslinux/serial.o
115 LIBOTHER_OBJS = \
116 atoi.o atol.o atoll.o calloc.o creat.o \
117 fgets.o fprintf.o fputc.o \
118 putchar.o \
119 getopt.o getopt_long.o \
120 lrand48.o stack.o memccpy.o memchr.o \
121 mempcpy.o memmem.o memmove.o memswap.o \
122 perror.o qsort.o seed48.o \
123 srand48.o sscanf.o strcasecmp.o strcat.o \
124 strerror.o errlist.o \
125 strnlen.o \
126 strncat.o strndup.o \
127 stpncpy.o \
128 strntoimax.o strntoumax.o strsep.o strspn.o strstr.o \
129 strtoimax.o strtok.o strtol.o strtoll.o strtoul.o strtoull.o \
130 strtoumax.o vprintf.o vsprintf.o \
131 asprintf.o vasprintf.o \
132 vsscanf.o \
133 skipspace.o \
134 chrreplace.o \
135 bufprintf.o \
136 inet.o dhcppack.o dhcpunpack.o \
137 strreplace.o \
138 lstrdup.o \
140 suffix_number.o \
142 getcwd.o fdopendir.o \
144 sys/line_input.o \
145 sys/colortable.o sys/screensize.o \
147 sys/stdcon_read.o sys/stdcon_write.o sys/rawcon_read.o \
148 sys/rawcon_write.o \
149 sys/null_read.o sys/null_write.o sys/serial_write.o \
151 sys/xserial_write.o \
153 sys/ansi.o \
155 sys/ansicon_write.o sys/ansiserial_write.o \
157 pci/cfgtype.o pci/scan.o pci/bios.o \
158 pci/readb.o pci/readw.o pci/readl.o \
159 pci/writeb.o pci/writew.o pci/writel.o \
161 sys/x86_init_fpu.o math/pow.o math/strtod.o \
162 syslinux/disk.o \
164 syslinux/setup_data.o
166 CORELIBOBJS = \
167 memcpy.o memset.o memcmp.o printf.o strncmp.o vfprintf.o \
168 strlen.o vsnprintf.o snprintf.o stpcpy.o strcmp.o strdup.o \
169 strcpy.o strncpy.o setjmp.o fopen.o fread.o fread2.o puts.o \
170 sprintf.o strlcat.o strchr.o strlcpy.o strncasecmp.o ctypes.o \
171 fputs.o fwrite2.o fwrite.o fgetc.o fclose.o errno.o lmalloc.o \
172 sys/err_read.o sys/err_write.o sys/null_read.o \
173 sys/stdcon_write.o \
174 syslinux/memscan.o strrchr.o \
175 libgcc/__ashldi3.o libgcc/__udivdi3.o \
176 libgcc/__negdi2.o libgcc/__ashrdi3.o libgcc/__lshrdi3.o \
177 libgcc/__muldi3.o libgcc/__udivmoddi4.o libgcc/__umoddi3.o \
178 libgcc/__divdi3.o libgcc/__moddi3.o \
179 $(LIBENTRY_OBJS) \
180 $(LIBMODULE_OBJS)
182 MINLIBOBJS = \
183 syslinux/ipappend.o \
184 syslinux/dsinfo.o \
185 $(LIBOTHER_OBJS) \
186 $(LIBGCC_OBJS) \
187 $(LIBCONSOLE_OBJS) \
188 $(LIBLOAD_OBJS) \
189 $(LIBZLIB_OBJS)
190 # $(LIBVESA_OBJS)
193 DYNLIBOBJS = \
194 $(LIBZLIB_OBJS) \
195 $(LIBPNG_OBJS) \
196 $(LIBJPG_OBJS) \
197 $(LIBPCI_OBJS) \
198 $(LIBVESA_OBJS) \
199 $(LIBSYSLINUX_OBJS) \
200 $(LIBLOAD_OBJS) \
201 $(LIBMISC_OBJS) \
202 $(DYNENTRY_OBJS)
205 LIBOBJS = \
206 $(DYNLIBOBJS)
208 BINDIR = /usr/bin
209 LIBDIR = /usr/lib
210 DATADIR = /usr/share
211 AUXDIR = $(DATADIR)/syslinux
212 INCDIR = /usr/include
213 COM32DIR = $(AUXDIR)/com32
215 all: libcom32.c32 libcom32min.a libcom32core.a
217 libcom32.elf : $(LIBOBJS)
218 rm -f $@
219 $(LD) -shared $(LDFLAGS) -soname $(patsubst %.elf,%.c32,$(@F)) -o $@ $^
221 libcom32min.a : $(MINLIBOBJS)
222 rm -f $@
223 $(AR) cq $@ $^
224 $(RANLIB) $@
226 libcom32core.a : $(CORELIBOBJS)
227 rm -f $@
228 $(AR) cq $@ $^
229 $(RANLIB) $@
231 tidy dist clean:
232 rm -f sys/vesa/alphatbl.c errlist.c
233 find . \( -name \*.o -o -name \*.a -o -name .\*.d -o -name \*.tmp \) -print0 | \
234 xargs -0r rm -f
236 spotless: clean
237 rm -f *.a *.c32
238 rm -f *~ \#* */*~ */\#*
240 install: all
241 mkdir -m 755 -p $(INSTALLROOT)$(COM32DIR)
242 install -m 644 com32.ld $(INSTALLROOT)$(COM32DIR)
243 -rm -rf $(INSTALLROOT)$(COM32DIR)/include
244 cp -r ../include $(INSTALLROOT)$(COM32DIR)
246 errlist.c: makeerrlist.pl ../include/errno.h
247 $(PERL) $< $(CFLAGS) -errlist > $@ || rm -f $@
249 # These files are performance critical, and doesn't compile well with -Os
250 sys/vesa/drawtxt.o: sys/vesa/drawtxt.c
251 $(CC) $(MAKEDEPS) $(CFLAGS) -O3 -c -o $@ $<
253 sys/vesa/alphatbl.c: sys/vesa/alphatbl.pl
254 $(PERL) $< > $@
256 jpeg/jidctflt.o: jpeg/jidctflt.c
257 $(CC) $(MAKEDEPS) $(CFLAGS) -O3 -c -o $@ $<
259 -include .*.d */.*.d */*/.*.d