Adding debian version 3.40~pre9-1.
[syslinux-debian/hramrach.git] / mtools / Makefile
blob546e3d14498bf42b51d317a41f12d95a065806a6
1 gcc_ok = $(shell if gcc $(1) ../dummy.c -o /dev/null 2>/dev/null; \
2 then echo '$(1)'; else echo '$(2)'; fi)
4 comma := ,
5 LDHASH := $(call gcc_ok,-Wl$(comma)--hash-style=both,)
7 CC = gcc
8 OPTFLAGS = -g -Os
9 INCLUDES = -I. -I.. -I../libfat
10 CFLAGS = -W -Wall -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(INCLUDES)
11 LDFLAGS = $(LDHASH) -s
13 SRCS = syslinux.c ../syslxmod.c ../bootsect_bin.c ../ldlinux_bin.c $(wildcard ../libfat/*.c)
14 OBJS = $(patsubst %.c,%.o,$(notdir $(SRCS)))
16 .SUFFIXES: .c .o .i .s .S
18 VPATH = .:..:../libfat
20 all: installer
22 tidy:
23 -rm -f *.o *.i *.s *.a .*.d
25 clean: tidy
26 -rm -f syslinux
28 spotless: clean
29 -rm -f *~
31 installer: syslinux
33 syslinux: $(OBJS)
34 $(CC) $(LDFLAGS) -o $@ $^
36 %.o: %.c
37 $(CC) -Wp,-MT,$@,-MMD,.$@.d $(CFLAGS) -c -o $@ $<
38 %.i: %.c
39 $(CC) $(CFLAGS) -E -o $@ $<
40 %.s: %.c
41 $(CC) $(CFLAGS) -S -o $@ $<
43 -include .*.d