Initial commit - UEFI application building

This commit is contained in:
Justin C. Miller
2017-01-02 13:40:42 -08:00
commit 89c2c70c28
13 changed files with 596 additions and 0 deletions

28
modules.mk Normal file
View File

@@ -0,0 +1,28 @@
ifeq "$(MOD_NAME)" ""
include "you must specify a MOD_NAME"
endif
ifndef SOURCES
SOURCES := $(wildcard src/modules/$(MOD_NAME)/*.c)
SOURCES += $(wildcard src/modules/$(MOD_NAME)/*.S)
endif
ifeq "$(SOURCES)" ""
include "you must specify a SOURCES list"
endif
MOD_SRC_D := src/modules/$(MOD_NAME)
MOD_BUILD_D := $(BUILD_D)/d.$(MOD_NAME)
MOD_LIBNAME := $(BUILD_D)/lib$(MOD_NAME).a
MOD_TARGETS += $(MOD_LIBNAME)
OBJS_$(MOD_NAME) := $(patsubst %.c,build/d.%.o,$(patsubst src/modules/%,%,$(SOURCES)))
$(MOD_LIBNAME): $(OBJS_$(MOD_NAME))
$(AR) cr $@ $(OBJS_$(MOD_NAME))
$(MOD_BUILD_D)/%.o: $(MOD_SRC_D)/%.c $(INIT_DEP)
$(CC) $(CFLAGS) -c -o $@ $<
DEPS += $(patsubst %.o,%.d,$(OBJS_$(MOD_NAME)))