aboutsummaryrefslogtreecommitdiffstats
path: root/dos/Makefile
diff options
context:
space:
mode:
authorhpa <hpa>2004-12-15 12:34:42 +0000
committerhpa <hpa>2004-12-15 12:34:42 +0000
commite5b229c776a5de62121a18a981119484d367ad90 (patch)
tree9995adbc26ca4f19be997e82c77dec5859fefe1b /dos/Makefile
parent883466394bb699dfbae62fcf025586c43a77e481 (diff)
downloadsyslinux.git-e5b229c776a5de62121a18a981119484d367ad90.tar.gz
syslinux.git-e5b229c776a5de62121a18a981119484d367ad90.tar.xz
syslinux.git-e5b229c776a5de62121a18a981119484d367ad90.zip
Convert the DOS installer to C like everything else.
Diffstat (limited to 'dos/Makefile')
-rw-r--r--dos/Makefile46
1 files changed, 32 insertions, 14 deletions
diff --git a/dos/Makefile b/dos/Makefile
index 5319daf2..947c1c89 100644
--- a/dos/Makefile
+++ b/dos/Makefile
@@ -1,21 +1,24 @@
-CC = gcc
+CC = gcc -m32
+LD = ld -m elf_i386
+OBJCOPY = objcopy
OPTFLAGS = -g -Os
-INCLUDES = -I./ -I../ -I../libfat/
-CFLAGS = -W -Wall $(OPTFLAGS) $(INCLUDES)
-LDFLAGS = -s
-NASM = nasm
+INCLUDES = -include code16.h -I. -I.. -I../libfat
+CFLAGS = -W -Wall -ffreestanding $(OPTFLAGS) $(INCLUDES)
+LDFLAGS = -T com16.ld
-SRCS =
-OBJS =
+SRCS = syslinux.c printf.c conio.c skipatou.c atou.c malloc.c free.c \
+ ../syslxmod.c ../bootsect_bin.c ../ldlinux_bin.c \
+ $(wildcard ../libfat/*.c)
+OBJS = crt0.o $(patsubst %.c,%.o,$(notdir $(SRCS)))
-.SUFFIXES: .c .o .i .s .S .asm .bin .lst .com
+.SUFFIXES: .c .o .i .s .S .elf .com
VPATH = .:..:../libfat
-all: syslinux.com
+all: installer
tidy:
- -rm -f *.o *.i *.s *.a .*.d *.lst
+ -rm -f *.o *.i *.s *.a .*.d *.elf
clean: tidy
-rm -f syslinux.com
@@ -23,9 +26,24 @@ clean: tidy
spotless: clean
-rm -f *~
-installer:
+installer: syslinux.com
+
+syslinux.elf: $(OBJS)
+ $(LD) $(LDFLAGS) -o $@ $^
+
+syslinux.com: syslinux.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 $@ $<
+%.s: %.S
+ $(CC) $(CFLAGS) -D__ASSEMBLY__ -S -o $@ $<
+
+-include .*.d
+
-syslinux.com: syslinux.asm ../ldlinux.bss ../ldlinux.sys
-.asm.com:
- $(NASM) $(INCLUDES) -f bin -o $@ -l $*.lst $<