summaryrefslogtreecommitdiff
path: root/sample/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'sample/Makefile')
-rw-r--r--sample/Makefile14
1 files changed, 9 insertions, 5 deletions
diff --git a/sample/Makefile b/sample/Makefile
index 58d6d052..54fdb097 100644
--- a/sample/Makefile
+++ b/sample/Makefile
@@ -18,6 +18,7 @@
CC = gcc
LD = ld
CFLAGS = -march=i386 -O2 -fomit-frame-pointer -I../com32/include
+SFLAGS = -march=i386
LDFLAGS = -s
OBJCOPY = objcopy
PPMTOLSS16 = ../ppmtolss16
@@ -26,10 +27,16 @@ PPMTOLSS16 = ../ppmtolss16
all: syslogo.lss hello.c32
-.c.o:
+%.o: %.S
+ $(CC) $(SFLAGS) -c -o $@ $<
+
+%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
-.elf.c32:
+%.elf: c32entry.o %.o
+ $(LD) -Ttext 0x101000 -e _start -o $@ $^
+
+%.c32: %.elf
$(OBJCOPY) -O binary $< $@
syslogo.lss: syslogo.png $(PPMTOLSS16)
@@ -37,9 +44,6 @@ syslogo.lss: syslogo.png $(PPMTOLSS16)
$(PPMTOLSS16) \#000000=0 \#d0d0d0=7 \#f6f6f6=15 \
> syslogo.lss
-hello.elf: hello.o
- $(LD) -Ttext 0x101000 -e _start -o $@ $<
-
clean:
rm -f *.lss *.o *.elf *.c32