Yet again, Makefiles...
Posted: Mon May 07, 2007 3:17 am
I'm finally well on my way to a properly working makefile! Only one thing now stands between me and a working makefile that I never have to touch again (theoretically).
It's this:
There should be filenames...
My makefile:
The thing is, 'make clean' works perfectly! Any ideas?
Edit: I put in a hack to make it work:
New problem, it seems even Cygwin has a character limit:
Edit 2: OK, source of the problem is now known:
It's this:
Code: Select all
ld-elf -T linker.ld -Map link.map -o kernel.bin
c:/djgpp/bin/ld-elf.exe: no input files
make: *** [kernel.bin] Error 1
My makefile:
Code: Select all
# compiler and flags
CXX:=gpp
CXXFLAGS:=-I ./include -nostdlib -fno-rtti -fno-exceptions
## DJGPP ELF-ENABLED LD ###
LD:=ld-elf
LDFLAGS:=-T linker.ld -Map link.map -o
# assembler
AS:=as-elf
# source and objects, and final binary
PROJDIRS:=$(find * -type d -not -name "CVS")
SRCS:=$(shell find $(PROJDIRS) -name "*.cc" -type f)
OBJS:=$(patsubst %.cc,%.o,$(SRCS))
FINALBIN:=kernel.bin
# clean up
clean:
rm $(OBJS) *.bin
# buld the full kernel
all: $(FINALBIN)
# link command
$(FINALBIN) : $(OBJS)
$(LD) $(LDFLAGS) $(FINALBIN) $(OJBS)
# C++ source
%.o : %.cc
$(CXX) $(CXXFLAGS) -c $< -o $@
# assembly
%.o : %.asm
$(AS) $< -o $@
Edit: I put in a hack to make it work:
Code: Select all
$(LD) $(LDFLAGS) $(FINALBIN) $(patsubst %.cc,%.o,$(SRCS))
Code: Select all
ld-elf -T linker.ld -Map link.map -o kernel.bin ./ata/ata_pio.o ./console/consol
e.o ./fs/fat32.o ./kernel.o ./lib/iostream.o ./portio.o ./syscore/fault.o ./sysc
ore/gdt.o ./syscore/idt.o ./syscore/irq.o ./syscore/math.o ./syscore/mem.o ./sys
core/paging.o ./syscore/timer.o ./tasking/mt.o
process_begin: CreateProcess(c:\djgpp\bin\ld-elf.exe, ld-elf -T linker.ld -Map l
ink.map -o kernel.bin ./ata/ata_pio.o ./console/console.o ./fs/fat32.o ./kernel.
o ./lib/iostream.o ./portio.o ./syscore/fault.o ./syscore/gdt.o ./syscore/idt.o
./syscore/irq.o ./syscore/math.o ./syscore/mem.o ./syscore/paging.o ./syscore/ti
mer.o ./tasking/mt.o, ...) failed.
make (e=87): The parameter is incorrect.
MSDN wrote: * Maximum Path Length
In the Windows API, the maximum length for a path is MAX_PATH, which is defined as 260 characters. A path is structured as follows: drive letter, colon, backslash, components separated by backslashes, and a null-terminating character. For example, the maximum path on the D drive is D:\<256 chars>NUL.