chore: update Makefile
This commit is contained in:
1 parent
3771599779
commit
cbee50f21c
1 file changed
+173
@@ -130,6 +130,179 @@ $(UBUILD)/sbrktest.elf: $(UBUILD)/sbrktest.o $(USERCOMMON) user/user.ld
|
||||
$(UBUILD)/fileread.elf: $(UBUILD)/fileread.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x70000000 -o $@ $(UBUILD)/fileread.o $(USERCOMMON)
|
||||
|
||||
$(UBUILD)/pipetest.elf: $(UBUILD)/pipetest.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x80000000 -o $@ $(UBUILD)/pipetest.o $(USERCOMMON)
|
||||
|
||||
$(UBUILD)/disktest.elf: $(UBUILD)/disktest.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x90000000 -o $@ $(UBUILD)/disktest.o $(USERCOMMON)
|
||||
|
||||
$(UBUILD)/fstest.elf: $(UBUILD)/fstest.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0xA0000000 -o $@ $(UBUILD)/fstest.o $(USERCOMMON)
|
||||
|
||||
$(UBUILD)/linktest.elf: $(UBUILD)/linktest.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0xB0000000 -o $@ $(UBUILD)/linktest.o $(USERCOMMON)
|
||||
|
||||
# Note: 0xC0000000 is deliberately skipped -- kmain.c's runPagingTest()
|
||||
# hardcodes a single supervisor-only diagnostic page at that exact address
|
||||
# for the whole kernel's lifetime, which would silently collide with a
|
||||
# user binary's first page (elfLoad's pagingMapUserRange only maps pages
|
||||
# that are not already present, so it would find that one "already mapped"
|
||||
# and leave it non-user-accessible, faulting the instant ring 3 tried to
|
||||
# execute from it).
|
||||
$(UBUILD)/spawntarget.elf: $(UBUILD)/spawntarget.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0xD0000000 -o $@ $(UBUILD)/spawntarget.o $(USERCOMMON)
|
||||
|
||||
# exectarget is never listed in kmain.c's boot-time spawnUser calls -- it is
|
||||
# only ever reached via proctest.c's userExec, which derives its stack/brk
|
||||
# purely from this ELF's own entry point (elfSlotStackTop/elfSlotBrkStart,
|
||||
# elf.c/elf.h). Its USER_BASE still needs to be reserved here so it never
|
||||
# collides with another binary's slot.
|
||||
$(UBUILD)/exectarget.elf: $(UBUILD)/exectarget.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0xE0000000 -o $@ $(UBUILD)/exectarget.o $(USERCOMMON)
|
||||
|
||||
$(UBUILD)/proctest.elf: $(UBUILD)/proctest.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0xF0000000 -o $@ $(UBUILD)/proctest.o $(USERCOMMON)
|
||||
|
||||
# Like exectarget, argtest is never in kmain.c's boot-time spawnUser list --
|
||||
# only proctest.c's userSpawn (with a specific argv) ever launches it. Its
|
||||
# slot picks up right where proctest's leaves off (0xF0000000 + elfSlotSize).
|
||||
$(UBUILD)/argtest.elf: $(UBUILD)/argtest.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x100000000 -o $@ $(UBUILD)/argtest.o $(USERCOMMON)
|
||||
|
||||
# fifomaster IS in kmain.c's boot-time spawnUser list (it needs no argv of
|
||||
# its own); fifowriter/fiforeader are only ever spawned by fifomaster, each
|
||||
# with the shared pipe handle it created as their one argv.
|
||||
$(UBUILD)/fifomaster.elf: $(UBUILD)/fifomaster.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x110000000 -o $@ $(UBUILD)/fifomaster.o $(USERCOMMON)
|
||||
|
||||
$(UBUILD)/fifowriter.elf: $(UBUILD)/fifowriter.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x120000000 -o $@ $(UBUILD)/fifowriter.o $(USERCOMMON)
|
||||
|
||||
$(UBUILD)/fiforeader.elf: $(UBUILD)/fiforeader.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x130000000 -o $@ $(UBUILD)/fiforeader.o $(USERCOMMON)
|
||||
|
||||
# killtest is in kmain.c's boot-time spawnUser list; killvictim is only ever
|
||||
# spawned by killtest, and is designed to never return on its own (see
|
||||
# killvictim.c) -- proving threadKill (sched.c) is the only way out.
|
||||
$(UBUILD)/killtest.elf: $(UBUILD)/killtest.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x140000000 -o $@ $(UBUILD)/killtest.o $(USERCOMMON)
|
||||
|
||||
$(UBUILD)/killvictim.elf: $(UBUILD)/killvictim.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x150000000 -o $@ $(UBUILD)/killvictim.o $(USERCOMMON)
|
||||
|
||||
# namedreader/namedwriter are both in kmain.c's boot-time spawnUser list,
|
||||
# with no parent-child relationship to each other -- they rendezvous purely
|
||||
# through the vfsMkfifo'd path "/tmp/rendezvous", not a shared argv handle.
|
||||
$(UBUILD)/namedreader.elf: $(UBUILD)/namedreader.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x160000000 -o $@ $(UBUILD)/namedreader.o $(USERCOMMON)
|
||||
|
||||
$(UBUILD)/namedwriter.elf: $(UBUILD)/namedwriter.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x170000000 -o $@ $(UBUILD)/namedwriter.o $(USERCOMMON)
|
||||
|
||||
# consolereader1/consolereader2 are both in kmain.c's boot-time spawnUser
|
||||
# list, with no relationship to each other -- each simply reads its own fd 0,
|
||||
# which keyboard.c's per-reader fan-out delivers a synthetic keystroke to
|
||||
# independently (consoleInjectorThread, kmain.c).
|
||||
$(UBUILD)/consolereader1.elf: $(UBUILD)/consolereader1.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x180000000 -o $@ $(UBUILD)/consolereader1.o $(USERCOMMON)
|
||||
|
||||
$(UBUILD)/consolereader2.elf: $(UBUILD)/consolereader2.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x190000000 -o $@ $(UBUILD)/consolereader2.o $(USERCOMMON)
|
||||
|
||||
# sigtest is spawned directly by kmain.c at boot; sigtarget/sigdefault are
|
||||
# only ever spawned at runtime by sigtest itself (userSpawn), the same
|
||||
# relationship killtest.elf/killvictim.elf already have -- each still needs
|
||||
# its own reserved USER_BASE regardless of who spawns it, since elfLoad
|
||||
# maps every ELF at whatever fixed address it was linked at and all of
|
||||
# them share this one address space (see elf.h).
|
||||
$(UBUILD)/sigtest.elf: $(UBUILD)/sigtest.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x1A0000000 -o $@ $(UBUILD)/sigtest.o $(USERCOMMON)
|
||||
|
||||
$(UBUILD)/sigtarget.elf: $(UBUILD)/sigtarget.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x1B0000000 -o $@ $(UBUILD)/sigtarget.o $(USERCOMMON)
|
||||
|
||||
$(UBUILD)/sigdefault.elf: $(UBUILD)/sigdefault.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x1C0000000 -o $@ $(UBUILD)/sigdefault.o $(USERCOMMON)
|
||||
|
||||
# jobtest is spawned directly by kmain.c at boot; jobtarget is only ever
|
||||
# spawned at runtime by jobtest itself (userSpawn), the same relationship
|
||||
# sigtest.elf/sigtarget.elf above already have.
|
||||
$(UBUILD)/jobtest.elf: $(UBUILD)/jobtest.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x1D0000000 -o $@ $(UBUILD)/jobtest.o $(USERCOMMON)
|
||||
|
||||
$(UBUILD)/jobtarget.elf: $(UBUILD)/jobtarget.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x1E0000000 -o $@ $(UBUILD)/jobtarget.o $(USERCOMMON)
|
||||
|
||||
# nesttest is spawned directly by kmain.c at boot; nesttarget is only ever
|
||||
# spawned at runtime by nesttest itself (userSpawn), the same relationship
|
||||
# sigtest.elf/sigtarget.elf and jobtest.elf/jobtarget.elf above already have.
|
||||
$(UBUILD)/nesttest.elf: $(UBUILD)/nesttest.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x1F0000000 -o $@ $(UBUILD)/nesttest.o $(USERCOMMON)
|
||||
|
||||
$(UBUILD)/nesttarget.elf: $(UBUILD)/nesttarget.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x200000000 -o $@ $(UBUILD)/nesttarget.o $(USERCOMMON)
|
||||
|
||||
# eintrtest is spawned directly by kmain.c at boot; eintrtarget is only ever
|
||||
# spawned at runtime by eintrtest itself (userSpawn), the same relationship
|
||||
# killtest.elf/killvictim.elf above already have.
|
||||
$(UBUILD)/eintrtest.elf: $(UBUILD)/eintrtest.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x210000000 -o $@ $(UBUILD)/eintrtest.o $(USERCOMMON)
|
||||
|
||||
$(UBUILD)/eintrtarget.elf: $(UBUILD)/eintrtarget.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x220000000 -o $@ $(UBUILD)/eintrtarget.o $(USERCOMMON)
|
||||
|
||||
# restarttest is spawned directly by kmain.c at boot; restarttarget is only
|
||||
# ever spawned at runtime by restarttest itself (userSpawn), the same
|
||||
# relationship eintrtest.elf/eintrtarget.elf above already have.
|
||||
$(UBUILD)/restarttest.elf: $(UBUILD)/restarttest.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x230000000 -o $@ $(UBUILD)/restarttest.o $(USERCOMMON)
|
||||
|
||||
$(UBUILD)/restarttarget.elf: $(UBUILD)/restarttarget.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x240000000 -o $@ $(UBUILD)/restarttarget.o $(USERCOMMON)
|
||||
|
||||
# masktest is spawned directly by kmain.c at boot; masktarget is only ever
|
||||
# spawned at runtime by masktest itself (userSpawn), the same relationship
|
||||
# nesttest.elf/nesttarget.elf above already have.
|
||||
$(UBUILD)/masktest.elf: $(UBUILD)/masktest.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x250000000 -o $@ $(UBUILD)/masktest.o $(USERCOMMON)
|
||||
|
||||
$(UBUILD)/masktarget.elf: $(UBUILD)/masktarget.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x260000000 -o $@ $(UBUILD)/masktarget.o $(USERCOMMON)
|
||||
|
||||
# sigchldtest is spawned directly by kmain.c at boot; sigchldchild is only
|
||||
# ever spawned at runtime by sigchldtest itself (userSpawn), the same
|
||||
# relationship nesttest.elf/nesttarget.elf above already have.
|
||||
$(UBUILD)/sigchldtest.elf: $(UBUILD)/sigchldtest.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x270000000 -o $@ $(UBUILD)/sigchldtest.o $(USERCOMMON)
|
||||
|
||||
$(UBUILD)/sigchldchild.elf: $(UBUILD)/sigchldchild.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x280000000 -o $@ $(UBUILD)/sigchldchild.o $(USERCOMMON)
|
||||
|
||||
# waitanytest is spawned directly by kmain.c at boot; waitanyfast and
|
||||
# waitanyslow are only ever spawned at runtime by waitanytest itself
|
||||
# (userSpawn), the same relationship nesttest.elf/nesttarget.elf above
|
||||
# already have.
|
||||
$(UBUILD)/waitanytest.elf: $(UBUILD)/waitanytest.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x290000000 -o $@ $(UBUILD)/waitanytest.o $(USERCOMMON)
|
||||
|
||||
$(UBUILD)/waitanyfast.elf: $(UBUILD)/waitanyfast.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x2A0000000 -o $@ $(UBUILD)/waitanyfast.o $(USERCOMMON)
|
||||
|
||||
$(UBUILD)/waitanyslow.elf: $(UBUILD)/waitanyslow.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x2B0000000 -o $@ $(UBUILD)/waitanyslow.o $(USERCOMMON)
|
||||
|
||||
# stopchldtest is spawned directly by kmain.c at boot; stopchldtarget is
|
||||
# only ever spawned at runtime by stopchldtest itself (userSpawn), the same
|
||||
# relationship jobtest.elf/jobtarget.elf above already have.
|
||||
$(UBUILD)/stopchldtest.elf: $(UBUILD)/stopchldtest.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x2C0000000 -o $@ $(UBUILD)/stopchldtest.o $(USERCOMMON)
|
||||
|
||||
$(UBUILD)/stopchldtarget.elf: $(UBUILD)/stopchldtarget.o $(USERCOMMON) user/user.ld
|
||||
$(LD) $(ULDFLAGS) --defsym USER_BASE=0x2D0000000 -o $@ $(UBUILD)/stopchldtarget.o $(USERCOMMON)
|
||||
|
||||
# nodefertest is spawned directly by kmain.c at boot; it is a single,
|
||||
# self-contained process (self-raises signals against its own pid) with no
|
||||
# spawned counterpart, unlike every other pair above.
|
||||
$(MKTAR): tools/mktar.c | $(BUILD)
|
||||
gcc -O2 -Wall -Wextra -o $@ $<
|
||||
|
||||
|
||||
Reference in new issue
Block a user