4k_sector: Support sectors >512
[syslinux.git] / memdump / Makefile
blob6a30431aae635d5e8af994559c3b7963f37d22a7
1 ## -----------------------------------------------------------------------
2 ##
3 ## Copyright 2001-2008 H. Peter Anvin - All Rights Reserved
4 ##
5 ## This program is free software; you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation, Inc., 53 Temple Place Ste 330,
8 ## Boston MA 02111-1307, USA; either version 2 of the License, or
9 ## (at your option) any later version; incorporated herein by reference.
11 ## -----------------------------------------------------------------------
14 ## memory dump utility
17 topdir = ..
18 MAKEDIR = $(topdir)/mk
19 include $(MAKEDIR)/embedded.mk
21 OPTFLAGS =
22 INCLUDES = -include code16.h -I.
23 LDFLAGS = -T com16.ld
25 SRCS = main.c serial.c ymsend.c srecsend.c
26 OBJS = crt0.o $(patsubst %.c,%.o,$(notdir $(SRCS)))
27 LIBOBJS = conio.o memcpy.o memset.o skipatou.o strtoul.o \
28 argv.o printf.o __divdi3.o __udivmoddi4.o
30 .SUFFIXES: .c .o .i .s .S .elf .com
32 TARGETS = memdump.com
34 all: $(TARGETS)
36 tidy dist:
37 -rm -f *.o *.i *.s *.a .*.d *.tmp *.elf
39 clean: tidy
41 spotless: clean
42 -rm -f *~ $(TARGETS)
44 installer:
46 memdump.elf: $(OBJS) libcom.a
47 $(LD) $(LDFLAGS) -o $@ $^
49 libcom.a: $(LIBOBJS)
50 -rm -f $@
51 $(AR) cq $@ $^
52 $(RANLIB) $@
54 memdump.com: memdump.elf
55 $(OBJCOPY) -O binary $< $@
57 %.o: %.c
58 $(CC) $(MAKEDEPS) $(CFLAGS) -c -o $@ $<
59 %.i: %.c
60 $(CC) $(MAKEDEPS) $(CFLAGS) -E -o $@ $<
61 %.s: %.c
62 $(CC) $(MAKEDEPS) $(CFLAGS) -S -o $@ $<
63 %.o: %.S
64 $(CC) $(MAKEDEPS) $(SFLAGS) -c -o $@ $<
65 %.s: %.S
66 $(CC) $(MAKEDEPS) $(SFLAGS) -E -o $@ $<
68 -include .*.d *.tmp