VPATH := $(VPATH):$(TOP_SRCDIR)/devices
VPATH := $(VPATH):$(TOP_SRCDIR)/lib
VPATH := $(VPATH):$(TOP_SRCDIR)/filesys
VPATH := $(VPATH):$(TOP_SRCDIR)/devices
VPATH := $(VPATH):$(TOP_SRCDIR)/lib
VPATH := $(VPATH):$(TOP_SRCDIR)/filesys
THREADS_SRC += interrupt.c # Interrupt core.
THREADS_SRC += intr-stubs.S # Interrupt stubs.
THREADS_SRC += synch.c # Synchronization.
THREADS_SRC += interrupt.c # Interrupt core.
THREADS_SRC += intr-stubs.S # Interrupt stubs.
THREADS_SRC += synch.c # Synchronization.
# Objects.
OBJECTS = $(patsubst %.c,%.o,$(patsubst %.S,%.o,$(SOURCES)))
all: diskimage.bin
intr-stubs.S: $(TOP_SRCDIR)/threads/intr-stubs.pl
# Objects.
OBJECTS = $(patsubst %.c,%.o,$(patsubst %.S,%.o,$(SOURCES)))
all: diskimage.bin
intr-stubs.S: $(TOP_SRCDIR)/threads/intr-stubs.pl
- objcopy -O binary -R .note -R .comment -S $< $@.data
- perl -e 'print "\0" x (4096 - (-s "$@.data") % 4096)' > $@.pad
- cat $@.data $@.pad > $@.tmp && mv $@.tmp $@
+ objcopy -O binary -R .note -R .comment -S $< $@.tmp
+ $(TOP_SRCDIR)/pad 4096 < $@.tmp > $@
loader.bin: loader.S kernel.bin
gcc -c $< -DKERNEL_LOAD_PAGES=`perl -e 'print +(-s "kernel.bin") / 4096;'`
loader.bin: loader.S kernel.bin
gcc -c $< -DKERNEL_LOAD_PAGES=`perl -e 'print +(-s "kernel.bin") / 4096;'`