build: add stpd.kernel.mk & stpd.module.mk
This commit is contained in:
parent
262020773c
commit
a79916574a
6 changed files with 73 additions and 66 deletions
|
@ -1,15 +1,15 @@
|
|||
include stpd.base.mk
|
||||
|
||||
COMMON_DIR = ../common
|
||||
SYS_DIR = ../../kernel/sys
|
||||
|
||||
KERNEL = stpdldr
|
||||
|
||||
COMMON_SRCS = const.inc \
|
||||
bootinfo.inc
|
||||
|
||||
SYS_SRCS = bootinfo.inc \
|
||||
register.inc
|
||||
|
||||
LOADER_SRCS = loader.asm \
|
||||
SRCS = loader.asm \
|
||||
$(addprefix $(COMMON_DIR)/, $(COMMON_SRCS)) \
|
||||
$(addprefix $(SYS_DIR)/, $(SYS_SRCS)) \
|
||||
fat.inc \
|
||||
|
@ -21,23 +21,10 @@ LOADER_SRCS = loader.asm \
|
|||
stpdfs.inc \
|
||||
disk.inc
|
||||
|
||||
.PHONY: all
|
||||
all: stpdldr.sys
|
||||
|
||||
stpdldr.sys: $(LOADER_SRCS)
|
||||
$(MSG_BUILD)
|
||||
@$(FASM) loader.asm $@ >/dev/null
|
||||
|
||||
%.inc: %.inc.in
|
||||
.PHONY: $(COMMON_DIR)/const.inc
|
||||
$(COMMON_DIR)/const.inc: $(COMMON_DIR)/const.inc.in
|
||||
@$(VERSION_SH)
|
||||
|
||||
.PHONY: install
|
||||
install: $(DESTDIR)/stpdldr.sys
|
||||
CLEANFILES = $(COMMON_DIR)/const.inc
|
||||
|
||||
$(DESTDIR)/stpdldr.sys: stpdldr.sys
|
||||
$(MSG_INSTALL)
|
||||
@install -D $< $@
|
||||
|
||||
CLEANFILES = stpdldr.sys $(COMMON_DIR)/const.inc
|
||||
|
||||
include stpd.clean.mk
|
||||
include stpd.kernel.mk
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
include stpd.base.mk
|
||||
|
||||
ASMINCS = sys/bootinfo.inc \
|
||||
sys/coff.inc \
|
||||
sys/cpu.inc \
|
||||
|
@ -44,33 +42,10 @@ SRCS = kernel.asm \
|
|||
bio.inc \
|
||||
$(ASMINCS)
|
||||
|
||||
.PHONY: all
|
||||
all: $(KERNEL).sys $(KERNEL).sym
|
||||
|
||||
.PHONY: const.inc
|
||||
const.inc: const.inc.in
|
||||
@$(VERSION_SH)
|
||||
|
||||
$(KERNEL).sys $(KERNEL).fas &: $(SRCS)
|
||||
$(MSG_BUILD)
|
||||
@$(FASM) -s $(KERNEL).fas kernel.asm $(KERNEL).sys >/dev/null
|
||||
CLEANFILES = const.inc
|
||||
|
||||
$(KERNEL).sym: $(KERNEL).fas
|
||||
$(MSG_CREATE)
|
||||
@$(FAS2SYM) -o $@ $<
|
||||
|
||||
.PHONY: install
|
||||
install: $(DESTDIR)/$(KERNEL).sys $(SYMSDIR)/$(KERNEL).sym
|
||||
|
||||
$(DESTDIR)/$(KERNEL).sys: $(KERNEL).sys
|
||||
$(MSG_INSTALL)
|
||||
@install -D $< $@
|
||||
|
||||
$(SYMSDIR)/$(KERNEL).sym: $(KERNEL).sym
|
||||
$(MSG_INSTALL)
|
||||
@install -D $< $@
|
||||
|
||||
CLEANFILES = $(KERNEL).sys $(KERNEL).fas $(KERNEL).sys const.inc
|
||||
|
||||
include stpd.clean.mk
|
||||
include stpd.inc.mk
|
||||
include stpd.kernel.mk
|
||||
|
|
|
@ -1,20 +1,3 @@
|
|||
include stpd.base.mk
|
||||
MODULE = dummy
|
||||
|
||||
MODULE = dummy.mod
|
||||
|
||||
all: $(MODULE)
|
||||
|
||||
$(MODULE): $(MODULE:.mod=.asm)
|
||||
$(MSG_BUILD)
|
||||
@fasm $^ $@
|
||||
|
||||
$(DESTDIR)/$(MODULE): $(MODULE)
|
||||
$(MSG_INSTALL)
|
||||
@install -D $< $@
|
||||
|
||||
.PHONY: install
|
||||
install: $(DESTDIR)/$(MODULE)
|
||||
|
||||
CLEANFILES = $(MODULE)
|
||||
|
||||
include stpd.clean.mk
|
||||
include stpd.module.mk
|
||||
|
|
32
share/mk/stpd.kernel.mk
Normal file
32
share/mk/stpd.kernel.mk
Normal file
|
@ -0,0 +1,32 @@
|
|||
include stpd.base.mk
|
||||
|
||||
ifdef KERNEL
|
||||
|
||||
.PHONY: all
|
||||
all: $(KERNEL).sys $(KERNEL).sym
|
||||
|
||||
$(KERNEL).sys $(KERNEL).fas &: $(SRCS)
|
||||
$(MSG_BUILD)
|
||||
@$(FASM) -s $(KERNEL).fas $< $(KERNEL).sys >/dev/null
|
||||
|
||||
$(KERNEL).sym: $(KERNEL).fas
|
||||
$(MSG_CREATE)
|
||||
@$(FAS2SYM) -o $@ $<
|
||||
|
||||
.PHONY: install
|
||||
install: $(DESTDIR)/$(KERNEL).sys $(SYMSDIR)/$(KERNEL).sym
|
||||
|
||||
$(DESTDIR)/$(KERNEL).sys: $(KERNEL).sys
|
||||
$(MSG_INSTALL)
|
||||
@install -D $< $@
|
||||
|
||||
$(SYMSDIR)/$(KERNEL).sym: $(KERNEL).sym
|
||||
$(MSG_INSTALL)
|
||||
@install -D $< $@
|
||||
|
||||
CLEANFILES += $(KERNEL).sys $(KERNEL).fas $(KERNEL).sys
|
||||
|
||||
include stpd.inc.mk
|
||||
include stpd.clean.mk
|
||||
|
||||
endif
|
8
share/mk/stpd.man.mk
Normal file
8
share/mk/stpd.man.mk
Normal file
|
@ -0,0 +1,8 @@
|
|||
include stpd.base.mk
|
||||
|
||||
ifdef MAN
|
||||
|
||||
_MSECTIONS= 1 2 3 4 5 6 7 8 9
|
||||
_MANINST=$(foreach S,$(_MSECTIONS),$(addprefix $(DESTDIR)$(MANDIR)/$S/,$(filter %.$S,$(MAN))))
|
||||
|
||||
endif
|
22
share/mk/stpd.module.mk
Normal file
22
share/mk/stpd.module.mk
Normal file
|
@ -0,0 +1,22 @@
|
|||
include stpd.base.mk
|
||||
|
||||
ifdef MODULE
|
||||
|
||||
all: $(MODULE).mod
|
||||
|
||||
%.mod: %.asm
|
||||
$(MSG_BUILD)
|
||||
@fasm $^ $@ >/dev/null
|
||||
|
||||
$(DESTDIR)/$(MODULE).mod: $(MODULE).mod
|
||||
$(MSG_INSTALL)
|
||||
@install -D $< $@
|
||||
|
||||
.PHONY: install
|
||||
install: $(DESTDIR)/$(MODULE).mod
|
||||
|
||||
CLEANFILES += $(MODULE).mod
|
||||
|
||||
include stpd.clean.mk
|
||||
|
||||
endif
|
Loading…
Add table
Reference in a new issue