Adding debian version 4.03+dfsg-7.
[syslinux-debian/hramrach.git] / dos / Makefile
blob2667de8ce043ca5f17b48a17a9ec4668af935686
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 ## MS-DOS FAT installer
17 topdir = ..
18 include $(topdir)/MCONFIG.embedded
20 CFLAGS += -D__MSDOS__
21 # CFLAGS += -DDEBUG
23 LDFLAGS = -T dosexe.ld
24 OPTFLAGS = -g
25 INCLUDES = -include code16.h -nostdinc -iwithprefix include \
26 -I. -I.. -I../libfat -I ../libinstaller -I ../libinstaller/getopt
28 SRCS = syslinux.c \
29 ../libinstaller/fat.c \
30 ../libinstaller/syslxmod.c \
31 ../libinstaller/syslxopt.c \
32 ../libinstaller/setadv.c \
33 ../libinstaller/getopt/getopt_long.c \
34 ../libinstaller/bootsect_bin.c \
35 ../libinstaller/mbr_bin.c \
36 $(wildcard ../libfat/*.c)
37 OBJS = header.o crt0.o ldlinux.o \
38 $(patsubst %.c,%.o,$(notdir $(SRCS)))
39 LIBOBJS = int2526.o conio.o memcpy.o memset.o memmove.o skipatou.o atou.o \
40 malloc.o free.o getopt_long.o getsetsl.o strchr.o strtoul.o \
41 strntoumax.o argv.o printf.o __divdi3.o __udivmoddi4.o
43 VPATH = .:../libfat:../libinstaller:../libinstaller/getopt
45 TARGETS = syslinux.com
47 all: $(TARGETS)
49 tidy dist:
50 -rm -f *.o *.i *.s *.a .*.d *.tmp *.elf *.lst
52 clean: tidy
54 spotless: clean
55 -rm -f *~ $(TARGETS)
57 installer:
59 syslinux.elf: $(OBJS) dosexe.ld libcom.a
60 $(LD) $(LDFLAGS) -o $@ $(OBJS) libcom.a
62 libcom.a: $(LIBOBJS)
63 -rm -f $@
64 $(AR) cq $@ $^
65 $(RANLIB) $@
67 syslinux.com: syslinux.elf
68 $(OBJCOPY) -O binary $< $@
69 $(UPX) --lzma --ultra-brute $@ || \
70 $(UPX) --ultra-brute $@ || \
71 true
73 %.com: %.asm
74 $(NASM) $(NASMOPT) -f bin -o $@ -MP -MD .$@.d -l $*.lst $<
76 ldlinux.o: ldlinux.S ../core/ldlinux.sys
78 -include .*.d *.tmp