aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2024-11-21 13:09:21 +0100
committerMiquel Sabaté Solà <mikisabate@gmail.com>2024-11-21 13:09:21 +0100
commit40ffc517e20c381ce8fdb3a881726a26a52e35db (patch)
treeb969f6e1bc4c400e8c2c8b1d5a18ed75d3f2fd95 /Makefile
parentd394978a73fce080128dc414e1771d8d89e1e1e0 (diff)
downloadfbos-40ffc517e20c.tar.gz
fbos-40ffc517e20c.zip
Initial parsing of the provided initrd file
We expect a CPIO archive with the 'newc' format for the initrd. Parse this archive from the given initrd address and fetch the address for each ELF executable while also pairing which task correspond to which ELF. This commit leaves to do the actual parsing of the ELF file for each task, while also leaving some string utilities to be refined. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
1 files changed, 10 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index bda1158..0d8bc44 100644
--- a/Makefile
+++ b/Makefile
@@ -60,9 +60,9 @@ SRC = $(filter-out kernel/fbos.ld.S, $(wildcard kernel/*.S kernel/*.c lib/*.c
OBJ = $(patsubst %.c,%.o,$(patsubst %.S,%.o,$(SRC)))
LINKER = kernel/fbos.ld
KRNL = fbos
-USR = usr/bin/foo
+USR = usr/bin/foo usr/bin/bar usr/bin/foobar
INIT = usr/initramfs.cpio
-TESTS = test/test_dt
+TESTS = test/test_dt test/test_initrd
LDFLAGS += -T $(LINKER)
@@ -111,19 +111,21 @@ usr/bin/%: usr/src/%.o
# Tests
.PHONY: test
-test: host_lib $(TESTS)
+test: host_lib usr $(TESTS)
$(Q) ./test/test_dt
+ $(Q) ./test/test_initrd
host_lib:
- $(Q) $(HOSTCC) $(WARNINGS) -Iinclude/ -g -c lib/dt.c -o lib/dt.o
+ $(Q) mkdir -p test/lib
+ $(Q) $(HOSTCC) $(WARNINGS) -Iinclude/ -g -c lib/dt.c -o test/lib/dt.o
+ $(Q) $(HOSTCC) $(WARNINGS) -Iinclude/ -g -c kernel/initrd.c -o test/lib/initrd.o
test/%.o: test/%.c
- $(E) " HOSTCC " $(basename $@)
$(Q) $(HOSTCC) $(WARNINGS) -g -Iinclude/ -c $< -o $@
test/%: test/%.o
- $(E) " HOSTLD " $@
- $(Q) $(HOSTCC) -Iinclude/ $< lib/dt.o -o $@
+ $(E) " TEST " $@
+ $(Q) $(HOSTCC) -Iinclude/ $< test/lib/*.o -o $@
##
# Hacking
@@ -142,7 +144,7 @@ gdb:
.PHONY: clean
clean:
- $(Q) rm -f $(OBJ) $(KRNL) $(LINKER) $(USR) usr/src/*.o $(INIT) test/*.o $(TESTS)
+ $(Q) rm -f $(OBJ) $(KRNL) $(LINKER) $(USR) usr/src/*.o $(INIT) test/*.o test/lib/*.o $(TESTS)
.PHONY: lint
lint: