Adding debian version 3.40~pre9-1.
[syslinux-debian/hramrach.git] / unix / Makefile
blobf0ab279a5327b7426f4c35398e4efc2c3054cc1e
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..
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
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 syslinux-nomtools
28 spotless: clean
29 -rm -f *~
31 installer: syslinux syslinux-nomtools
33 syslinux: $(OBJS)
34 $(CC) $(LDFLAGS) -o $@ $^
36 syslinux-nomtools: syslinux
37 ln -f $< $@
39 %.o: %.c
40 $(CC) -Wp,-MT,$@,-MMD,.$@.d $(CFLAGS) -c -o $@ $<
41 %.i: %.c
42 $(CC) $(CFLAGS) -E -o $@ $<
43 %.s: %.c
44 $(CC) $(CFLAGS) -S -o $@ $<
46 -include .*.d