Centralize configurables; better "make install" etc
[profile/ivi/syslinux.git] / com32 / lib / MCONFIG
1 # -*- makefile -*-
2
3 topdir = ../..
4 include $(topdir)/MCONFIG
5
6 GCCOPT := $(call gcc_ok,-m32,) $(call gcc_ok,-fno-stack-protector,)
7
8 INCLUDE = -I.
9 STRIP   = strip --strip-all -R .comment -R .note
10
11 # zlib and libpng configuration flags
12 LIBFLAGS = -DDYNAMIC_CRC_TABLE -DPNG_NO_CONSOLE_IO \
13            -DPNG_NO_WRITE_SUPPORTED \
14            -DPNG_NO_MNG_FEATURES \
15            -DPNG_NO_READ_tIME -DPNG_NO_WRITE_tIME
16
17 # We need some features in libpng which apparently aren't available in the
18 # fixed-point versions.  It's OK, because we have to have a non-graphical
19 # fallback anyway, just use that on old machines...
20 # LIBFLAGS += -DPNG_NO_FLOATING_POINT_SUPPORTED
21
22 REQFLAGS  = $(GCCOPT) -g -mregparm=3 -DREGPARM=3 -D__COM32__ \
23             -nostdinc -iwithprefix include -I. -I./sys -I../include
24 OPTFLAGS  = -Os -march=i386 -falign-functions=0 -falign-jumps=0 \
25             -falign-labels=0 -ffast-math -fomit-frame-pointer
26 WARNFLAGS = -W -Wall -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Winline
27
28 CFLAGS  = -Wp,-MT,$@,-MD,$(dir $@).$(notdir $@).d $(OPTFLAGS) \
29           $(REQFLAGS) $(WARNFLAGS) $(LIBFLAGS)
30 LDFLAGS = -m elf32_i386
31
32 .SUFFIXES: .c .o .a .so .lo .i .S .s .ls .ss .lss
33
34 % : %.c # Cancel default rule
35
36 % : %.S
37
38 .c.o:
39         $(CC) $(CFLAGS) -c -o $@ $<
40
41 .c.i:
42         $(CC) $(CFLAGS) -E -o $@ $<
43
44 .c.s:
45         $(CC) $(CFLAGS) -S -o $@ $<
46
47 .S.o:
48         $(CC) $(CFLAGS) -D__ASSEMBLY__ -c -o $@ $<
49
50 .S.s:
51         $(CC) $(CFLAGS) -D__ASSEMBLY__ -E -o $@ $<
52
53 .S.lo:
54         $(CC) $(CFLAGS) $(SOFLAGS) -D__ASSEMBLY__ -c -o $@ $<
55
56 .S.ls:
57         $(CC) $(CFLAGS) $(SOFLAGS) -D__ASSEMBLY__ -E -o $@ $<
58
59 .s.o:
60         $(CC) $(CFLAGS) -x assembler -c -o $@ $<
61
62 .ls.lo:
63         $(CC) $(CFLAGS) $(SOFLAGS) -x assembler -c -o $@ $<
64
65 .c.lo:
66         $(CC) $(CFLAGS) $(SOFLAGS) -c -o $@ $<
67
68 .c.ls:
69         $(CC) $(CFLAGS) $(SOFLAGS) -S -o $@ $<