stdio.h: change fflush() from "extern inline" to "static inline"
[syslinux.git] / extlinux / Makefile
blobec212d683101fcc4d4a4afa0a1e80e1c10946171
1 TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
2 CC = gcc
4 gcc_ok = $(shell tmpf=$(TMPFILE); if $(CC) $(1) ../dummy.c -o $$tmpf 2>/dev/null; \
5 then echo '$(1)'; else echo '$(2)'; fi; rm -f $$tmpf)
7 comma := ,
8 LDHASH := $(call gcc_ok,-Wl$(comma)--hash-style=both,)
10 OPTFLAGS = -g -Os
11 INCLUDES = -I. -I.. -I../libinstaller
12 CFLAGS = -W -Wall -Wno-sign-compare -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(INCLUDES)
13 LDFLAGS = $(LDHASH) # -s
15 SRCS = main.c \
16 ../libinstaller/setadv.c \
17 ../libinstaller/extlinux_bss_bin.c \
18 ../libinstaller/extlinux_sys_bin.c
19 OBJS = $(patsubst %.c,%.o,$(notdir $(SRCS)))
21 .SUFFIXES: .c .o .i .s .S
23 VPATH = .:../libinstaller
25 all: installer
27 tidy dist:
28 -rm -f *.o *.i *.s *.a .*.d
30 clean: tidy
31 -rm -f extlinux
33 spotless: clean
34 -rm -f *~
36 installer: extlinux
38 extlinux: $(OBJS)
39 $(CC) $(LDFLAGS) -o $@ $^
41 %.o: %.c
42 $(CC) -Wp,-MT,$@,-MMD,.$@.d $(CFLAGS) -c -o $@ $<
43 %.i: %.c
44 $(CC) $(CFLAGS) -E -o $@ $<
45 %.s: %.c
46 $(CC) $(CFLAGS) -S -o $@ $<
48 -include .*.d