This commit is contained in:
2017-09-17 10:35:55 -04:00
parent 2532bc077f
commit 8e3a8056fa
2 changed files with 10 additions and 7 deletions

View File

@@ -2,8 +2,6 @@ CONFIG = config.mak
include $(CONFIG)
CONFIGURE = $(SRC_DIR)/
COV_DIR=$(OUT)/coverage/
APP_DIR=$(SRC_DIR)/apps/
CC=gcc
@@ -22,7 +20,7 @@ LDFLAGS += $(LDFLAGS_EXTRA)
FILTER = $(foreach v,$(2),$(if $(findstring $(1),$(v)),$(v),))
C_SOURCES = $(shell find $(SRC_DIR) -name "*.c")
ALL_OBJS = $(patsubst $(SRC_DIR)%.c, $(OUT)%.o, $(C_SOURCES))
ALL_OBJS = $(patsubst $(SRC_DIR)/%.c, $(OUT)/%.o, $(C_SOURCES))
APP_OBJS = $(filter $(OUT)/apps/%, $(ALL_OBJS))
TEST_OBJS = $(call FILTER,/tests/, $(ALL_OBJS))
OBJS = $(filter-out $(TEST_OBJS) $(APP_OBJS), $(ALL_OBJS))
@@ -31,7 +29,7 @@ APPS = $(patsubst %.o, %, $(APP_OBJS))
$(info SRC_DIR is ${SRC_DIR})
$(info OUT is ${OUT})
$(info C_SOURCES is ${C_SOURCES})
$(info OBJSs ${OBJS})
$(info OBJSs is ${OBJS})
$(info ALL_OBJS is ${ALL_OBJS})
$(info APP_OBJS is ${APP_OBJS})
$(info TEST_OBJS is ${TEST_OBJS})
@@ -50,7 +48,7 @@ tests: $(TESTS)
$(ALL_OBJS): $(CONFIG)
$(OUT)%.o: $(SRC_DIR)%.c $(CONFIG)
$(OUT)/%.o: $(SRC_DIR)/%.c $(CONFIG)
@echo " CC $@"
$(shell mkdir -p $(@D))
$(CC) -c $(CCFLAGS) -o $@ $<
@@ -64,7 +62,6 @@ $(APPS) $(TESTS): $(OBJS) $$@.o
@$(shell mkdir -p $(@D))
$(CC) $^ $(LDFLAGS) -o $@
.PHONY: check cov-report
define run_tests =
@@ -100,7 +97,7 @@ coverage-report: coverage
.PHONY: clean realclean cov-clean
cov-clean:
@find $(OUT)/ \( -iname *.gcno -o -iname *.gcda \) -delete
@find $(OUT) \( -iname *.gcno -o -iname *.gcda \) -delete
@rm -rf $(COV_DIR)
clean: cov-clean
@@ -108,3 +105,6 @@ clean: cov-clean
realclean: clean
@rm -f $(CONFIG)
%.o:
$(info "caught in default rule $@")

View File

@@ -409,6 +409,8 @@ static int cpu_reg8_to_idx[NUM_LR35902_REGS_8] = {
[LR35902_REG_HL_DEREF] = -1,
};
uint8_t lr35902_get_reg_8(const struct lr35902_state *cpu, lr35902_regs_8 reg)
{
ASSERT(reg < NUM_LR35902_REGS_8);
@@ -421,6 +423,7 @@ void lr35902_set_reg_16(struct lr35902_state *cpu, lr35902_regs_16 reg,
{
ASSERT(reg < NUM_LR35902_REGS_16 && reg >= 0);
cpu->regs_16[cpu_reg16_to_idx[reg]] = val;
lr3
}
void lr35902_set_reg_8(struct lr35902_state *cpu, lr35902_regs_8 reg,