diff options
| author | H. Peter Anvin <hpa@zytor.com> | 2007-09-25 16:38:31 -0700 |
|---|---|---|
| committer | H. Peter Anvin <hpa@zytor.com> | 2007-09-25 16:38:31 -0700 |
| commit | 223f5298620a3b3be9fbd206e2a3fbb388487da0 (patch) | |
| tree | 286635488927e801c646d80e21d6a194261ed75b /memdump/Makefile | |
| parent | 57556d8f612128679464667ce124ddc611795db2 (diff) | |
| parent | a81fb89a445ae0dca286c861d8d51f705533df0d (diff) | |
| download | syslinux-3.60-pre2.tar.gz | |
Merge commit 'syslinux-3.52' into gpxe-supportsyslinux-3.60-pre2
Diffstat (limited to 'memdump/Makefile')
| -rw-r--r-- | memdump/Makefile | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/memdump/Makefile b/memdump/Makefile new file mode 100644 index 00000000..40497028 --- /dev/null +++ b/memdump/Makefile @@ -0,0 +1,64 @@ +TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX) + +gcc_ok = $(shell tmpf=$(TMPFILE); if gcc $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \ + then echo $(1); else echo $(2); fi; rm -f $$tmpf) + +M32 := $(call gcc_ok,-m32,) $(call gcc_ok,-ffreestanding,) $(call gcc_ok,-fno-stack-protector,) + +CC = gcc +LD = ld -m elf_i386 +OBJCOPY = objcopy +OPTFLAGS = -g -Os -march=i386 -falign-functions=0 -falign-jumps=0 -falign-loops=0 -fomit-frame-pointer +INCLUDES = -include code16.h -I. +CFLAGS = $(M32) -mregparm=3 -DREGPARM=3 -W -Wall -msoft-float $(OPTFLAGS) $(INCLUDES) +LDFLAGS = -T com16.ld +AR = ar +RANLIB = ranlib +LIBGCC := $(shell $(CC) --print-libgcc) + +SRCS = main.c serial.c ymsend.c +OBJS = crt0.o $(patsubst %.c,%.o,$(notdir $(SRCS))) +LIBOBJS = conio.o memcpy.o memset.o skipatou.o strtoul.o \ + argv.o printf.o __divdi3.o __udivmoddi4.o + +.SUFFIXES: .c .o .i .s .S .elf .com + +VPATH = .:..:../libfat + +TARGETS = memdump.com + +all: $(TARGETS) + +tidy: + -rm -f *.o *.i *.s *.a .*.d *.elf + +clean: tidy + +spotless: clean + -rm -f *~ $(TARGETS) + +installer: + +memdump.elf: $(OBJS) libcom.a + $(LD) $(LDFLAGS) -o $@ $^ + +libcom.a: $(LIBOBJS) + -rm -f $@ + $(AR) cq $@ $^ + $(RANLIB) $@ + +memdump.com: memdump.elf + $(OBJCOPY) -O binary $< $@ + +%.o: %.c + $(CC) -Wp,-MT,$@,-MD,.$@.d $(CFLAGS) -c -o $@ $< +%.i: %.c + $(CC) $(CFLAGS) -E -o $@ $< +%.s: %.c + $(CC) $(CFLAGS) -S -o $@ $< +%.o: %.S + $(CC) -Wp,-MT,$@,-MD,.$@.d $(CFLAGS) -D__ASSEMBLY__ -c -o $@ $< +%.s: %.S + $(CC) $(CFLAGS) -E -o $@ $< + +-include .*.d |
