Skip to content

Commit

Permalink
Fix out of tree build
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbjornx committed Jun 11, 2017
1 parent 07920b6 commit 176e476
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions Makefile
Expand Up @@ -7,6 +7,7 @@
export
CROSS_COMPILE = i386-pc-posnk-
ARCH = i386
BUILDDIR = ./

# define the C compiler to use
CC = @echo " [ CC ] " $< ; $(CROSS_COMPILE)gcc
Expand Down Expand Up @@ -175,13 +176,16 @@ OBJS_KERN = $(BUILDDIR)arch/$(ARCH).o $(OBJS) $(OBJS_DLHEAPMM) $(OBJS_DRIVER)

#install_h

$(BUILDDIR):
find -type d -links 2 -exec mkdir -p "$(BUILDDIR){}" \;

.PHONY: depend clean

default: default_$(ARCH)

all: default

$(BUILDDIR)_dmake: build/driverinit.c build/drivermake.m4 fs/fs.list
$(BUILDDIR)_dmake: $(BUILDDIR) build/driverinit.c build/drivermake.m4 fs/fs.list
$(M4) -I . build/drivermake.m4 > $(BUILDDIR)_dmake
$(CPP) -I . build/driverinit.c > $(BUILDDIR)_dinit.c

Expand All @@ -190,9 +194,9 @@ include $(BUILDDIR)_dmake
$(OBJS_DRIVER): $(BUILDDIR)%.o: %.c
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@

vmpos: $(BUILDDIR)_dmake $(OBJS_KERN)
$(LD) $(LFLAGS) $(LIBS) -T arch/$(ARCH)/kern.ld -o vmpos $(OBJS_KERN)
@rm _dmake kernel/version.o
$(BUILDDIR)vmpos: $(BUILDDIR)_dmake $(OBJS_KERN)
$(LD) $(LFLAGS) $(LIBS) -T arch/$(ARCH)/kern.ld -o $@ $(OBJS_KERN)
@rm $(BUILDDIR)_dmake $(BUILDDIR)kernel/version.o

install_h:
@cp include/crt/sys/ioctl.h ../nkgcc/newlib-2.1.0/newlib/libc/sys/posnk/sys/ioctl.h
Expand Down
2 changes: 1 addition & 1 deletion arch/i386/Makefile
Expand Up @@ -49,7 +49,7 @@ ARCHOBJ=$(BUILDDIR)arch/i386.o
$(ARCHOBJ): $(OBJS_I386)
$(RLD) $(RLDFLAGS) -r $(OBJS_I386) -o $@

default_i386: vmpos
default_i386: $(BUILDDIR)vmpos

cdrom_i386: vmpos cdrom_files/ramdisk.ext2
# @echo " [ TAR ] initrd.tar" ; ./mkinitrd_pos
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 176e476

Please sign in to comment.