Home | History | Annotate | Download | only in lib
      1 #
      2 # ONLY INCLUDE MIT OR 2/3-BSD-LICENSED CODE IN THIS LIBRARY
      3 #
      4 
      5 # Include configuration rules
      6 NOGPL := 1
      7 VPATH = $(SRC)
      8 include $(MAKEDIR)/lib.mk
      9 
     10 ## OPTIONAL OBJECTS, AVAILABLE AS DYNAMIC LINKED MODULES
     11 # PNG library object files
     12 LIBPNG_OBJS = \
     13 	libpng/png.o libpng/pngset.o libpng/pngget.o libpng/pngrutil.o  \
     14 	libpng/pngtrans.o libpng/pngwutil.o libpng/pngread.o		\
     15 	libpng/pngrio.o libpng/pngwio.o libpng/pngwrite.o		\
     16 	libpng/pngrtran.o libpng/pngwtran.o libpng/pngmem.o		\
     17 	libpng/pngerror.o libpng/pngpread.o
     18 
     19 # JPG library object files
     20 LIBJPG_OBJS = \
     21 	jpeg/tinyjpeg.o jpeg/jidctflt.o	jpeg/decode1.o jpeg/decode3.o   \
     22 	jpeg/rgb24.o jpeg/bgr24.o jpeg/yuv420p.o jpeg/grey.o		\
     23 	jpeg/rgba32.o jpeg/bgra32.o					
     24 
     25 ifdef EFI_BUILD
     26 I915VESA_OBJ =
     27 else
     28 I915VESA_OBJ = sys/vesa/i915resolution.o
     29 endif
     30 
     31 LIBVESA_OBJS = \
     32 	sys/vesacon_write.o sys/vesaserial_write.o			\
     33 	sys/vesa/initvesa.o sys/vesa/drawtxt.o	sys/vesa/background.o	\
     34 	sys/vesa/alphatbl.o sys/vesa/screencpy.o sys/vesa/fmtpixel.o	\
     35 	$(I915VESA_OBJ)
     36 
     37 LIBMISC_OBJS = \
     38 	sys/libansi.o sys/gpxe.o
     39 
     40 LIBPCI_OBJS = \
     41 	pci/cfgtype.o pci/scan.o pci/bios.o				\
     42 	pci/readb.o pci/readw.o pci/readl.o				\
     43 	pci/writeb.o pci/writew.o pci/writel.o
     44 
     45 LIBSYSLINUX_OBJS = \
     46 	syslinux/reboot.o syslinux/keyboard.o				\
     47 	syslinux/version.o						\
     48 	syslinux/pxe_get_cached.o syslinux/pxe_get_nic.o		\
     49 	syslinux/pxe_dns.o						\
     50 	syslinux/video/fontquery.o syslinux/video/reportmode.o
     51 
     52 DYNENTRY_OBJS = \
     53 	atexit.o onexit.o abort.o
     54 
     55 MINLIBOBJS = \
     56 	syslinux/ipappend.o \
     57 	syslinux/dsinfo.o \
     58 	$(LIBOTHER_OBJS) \
     59 	$(LIBGCC_OBJS) \
     60 	$(LIBCONSOLE_OBJS) \
     61 	$(LIBLOAD_OBJS) \
     62 	$(LIBZLIB_OBJS)
     63 #	$(LIBVESA_OBJS)
     64 
     65 DYNLIBOBJS = \
     66 	$(LIBZLIB_OBJS) \
     67 	$(LIBPNG_OBJS) \
     68 	$(LIBJPG_OBJS) \
     69 	$(LIBPCI_OBJS) \
     70 	$(LIBVESA_OBJS) \
     71 	$(LIBSYSLINUX_OBJS) \
     72 	$(LIBLOAD_OBJS) \
     73 	$(LIBMISC_OBJS) \
     74 	$(DYNENTRY_OBJS)
     75 
     76 
     77 LIBOBJS = $(DYNLIBOBJS)
     78 
     79 BINDIR   = /usr/bin
     80 LIBDIR   = /usr/lib
     81 DATADIR  = /usr/share
     82 AUXDIR   = $(DATADIR)/syslinux
     83 INCDIR   = /usr/include
     84 COM32DIR = $(AUXDIR)/com32
     85 
     86 all: makeoutputdirs libcom32.c32 libcom32min.a libcom32core.a
     87 
     88 makeoutputdirs:
     89 	@mkdir -p $(foreach b, \
     90 		$(addprefix $(OBJ)/,$(sort $(dir $(LIBOBJS) $(MINLIBOBJS) $(CORELIBOBJS)))),$(b))
     91 
     92 libcom32.elf : $(LIBOBJS)
     93 	rm -f $@
     94 	$(LD) -shared $(LDFLAGS) -soname $(patsubst %.elf,%.c32,$(@F)) -o $@ $^
     95 
     96 libcom32min.a : $(MINLIBOBJS)
     97 	rm -f $@
     98 	$(AR) cq $@ $^
     99 	$(RANLIB) $@
    100 
    101 libcom32core.a : $(CORELIBOBJS)
    102 	rm -f $@
    103 	$(AR) cq $@ $^
    104 	$(RANLIB) $@
    105 
    106 tidy dist clean:
    107 	rm -f sys/vesa/alphatbl.c errlist.c
    108 	find . \( -name \*.o -o -name \*.a -o -name .\*.d -o -name \*.tmp \) -print0 | \
    109 		xargs -0r rm -f
    110 
    111 spotless: clean
    112 	rm -f *.a *.c32
    113 	rm -f *~ \#* */*~ */\#*
    114 
    115 install: all
    116 	mkdir -m 755 -p $(INSTALLROOT)$(COM32DIR)
    117 	install -m 644 $(SRC)/com32.ld $(INSTALLROOT)$(COM32DIR)
    118 	-rm -rf $(INSTALLROOT)$(COM32DIR)/include
    119 	cp -r $(SRC)/../include $(INSTALLROOT)$(COM32DIR)
    120 
    121 errlist.c: makeerrlist.pl $(SRC)/../include/errno.h
    122 	$(PERL) $<  $(CFLAGS) -errlist > $@ || rm -f $@
    123 
    124 # These files are performance critical, and doesn't compile well with -Os
    125 sys/vesa/drawtxt.o: sys/vesa/drawtxt.c
    126 	$(CC) $(MAKEDEPS) $(CFLAGS) -O3 -c -o $@ $<
    127 
    128 sys/vesa/alphatbl.c: sys/vesa/alphatbl.pl
    129 	$(PERL) $< > $@
    130 
    131 jpeg/jidctflt.o: jpeg/jidctflt.c
    132 	$(CC) $(MAKEDEPS) $(CFLAGS) -O3 -c -o $@ $<
    133 
    134 -include .*.d */.*.d */*/.*.d
    135