Skip to content

Commit

Permalink
more cleanup on makefile.mk
Browse files Browse the repository at this point in the history
  • Loading branch information
justgook committed Aug 14, 2023
1 parent 09cc7a5 commit c310476
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
13 changes: 13 additions & 0 deletions makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,32 @@ release: CFLAGS= $(FLAGS)
release: AFLAGS= $(FLAGS)
release: LIBMD= $(LIB)/libmd.a
release: $(OUT)/rom.bin $(OUT)/symbol.txt
.PHONY: release

#release: $(info $$var is [${SRC_C}])

debug: FLAGS= $(DEFAULT_FLAGS) -O1 -DDEBUG=1
debug: CFLAGS= $(FLAGS) -ggdb
debug: AFLAGS= $(FLAGS)
debug: LIBMD= $(LIB)/libmd_debug.a
debug: $(OUT)/rom.bin $(OUT)/rom.out $(OUT)/symbol.txt
.PHONY: debug

asm: FLAGS= $(DEFAULT_FLAGS) -O3 -fuse-linker-plugin -fno-web -fno-gcse -fno-unit-at-a-time -fomit-frame-pointer -S
asm: CFLAGS= $(FLAGS)
asm: AFLAGS= $(FLAGS)
asm: LIBMD= $(LIB)/libmd.a
asm: $(LSTS)
.PHONY: asm

init: $(SRC)/main.c
$(MKDIR) -p $(RES)
$(MKDIR) -p $(INCLUDE)
.PHONY: init

$(SRC)/main.c:
$(MKDIR) -p $(dir $@)
$(CP) $(GDK)/template/src/main.c $@

# include ext.mk if it exists (better to do it after release rule definition)
ifneq ("$(wildcard $(GDK)/ext.mk)","")
Expand Down
18 changes: 18 additions & 0 deletions template/src/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include "genesis.h"


int main(bool hardReset)
{
VDP_drawText("Hello world !", 12, 12);

while(TRUE)
{
// nothing to do here
// ...

// always call this method at the end of the frame
SYS_doVBlankProcess();
}

return 0;
}

0 comments on commit c310476

Please sign in to comment.