diff --git a/.gitignore b/.gitignore index 37df383..5b6cd5e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ *.3dsx *.elf *.smdh +*.tar.bz2 Thumbs.db build/ lib/ diff --git a/Makefile b/Makefile index eb3abb4..c58dbc1 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,12 @@ endif include $(DEVKITARM)/3ds_rules +export CITRO3D_MAJOR := 1 +export CITRO3D_MINOR := 0 +export CITRO3D_PATCH := 0 + +VERSION := $(CITRO3D_MAJOR).$(CITRO3D_MINOR).$(CITRO3D_PATCH) + #--------------------------------------------------------------------------------- # TARGET is the name of the output # BUILD is the directory where object files & intermediate files will be placed @@ -27,9 +33,8 @@ INCLUDES := include #--------------------------------------------------------------------------------- ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -CFLAGS := -g -Wall -O2 -mword-relocations \ - -ffunction-sections \ - -fomit-frame-pointer -ffast-math \ +CFLAGS := -g -Wall -Werror -O2 -mword-relocations \ + -fomit-frame-pointer -ffunction-sections \ $(ARCH) CFLAGS += $(INCLUDE) -DARM11 -D_3DS -DCITRO3D_BUILD @@ -61,7 +66,6 @@ export DEPSDIR := $(CURDIR)/$(BUILD) CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) -VSHFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.vsh))) BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) #--------------------------------------------------------------------------------- @@ -78,7 +82,7 @@ else endif #--------------------------------------------------------------------------------- -export OFILES := $(addsuffix .o,$(BINFILES)) $(VSHFILES:.vsh=.shbin.o) \ +export OFILES := $(addsuffix .o,$(BINFILES)) \ $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o) export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ @@ -90,6 +94,13 @@ export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \ #--------------------------------------------------------------------------------- all: $(BUILD) +dist: all + @tar -cjf citro3d-$(VERSION).tar.bz2 include lib + +install: dist + mkdir -p $(DEVKITPRO)/libctru + bzip2 -cd citro3d-$(VERSION).tar.bz2 | tar -xf - -C $(DEVKITPRO)/libctru + lib: @[ -d $@ ] || mkdir -p $@ @@ -118,17 +129,6 @@ $(OUTPUT) : $(OFILES) @echo $(notdir $<) @$(bin2o) -#--------------------------------------------------------------------------------- -%.shbin.o: %.vsh - @echo $(notdir $<) - $(eval CURBIN := $(patsubst %.vsh,%.shbin,$(notdir $<))) - $(eval CURH := $(patsubst %.vsh,%.vsh.h,$(notdir $<))) - @picasso -o $(CURBIN) $< -h $(CURH) - @bin2s $(CURBIN) | $(AS) -o $@ - @echo "extern const u8" `(echo $(CURBIN) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo $(CURBIN) | tr . _)`.h - @echo "extern const u8" `(echo $(CURBIN) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(CURBIN) | tr . _)`.h - @echo "extern const u32" `(echo $(CURBIN) | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> `(echo $(CURBIN) | tr . _)`.h - -include $(DEPENDS) #--------------------------------------------------------------------------------------- diff --git a/examples/fragment_light/Makefile b/examples/fragment_light/Makefile index 238a1f3..4be5cd3 100644 --- a/examples/fragment_light/Makefile +++ b/examples/fragment_light/Makefile @@ -54,7 +54,7 @@ LIBS := -lcitro3d -lctru -lm # list of directories containing libraries, this must be the top level containing # include and lib #--------------------------------------------------------------------------------- -LIBDIRS := $(CTRULIB) $(CURDIR)/../.. +LIBDIRS := $(CTRULIB) #--------------------------------------------------------------------------------- diff --git a/examples/gputest/Makefile b/examples/gputest/Makefile index 61e2ca4..1c7cc88 100644 --- a/examples/gputest/Makefile +++ b/examples/gputest/Makefile @@ -54,7 +54,7 @@ LIBS := -lcitro3d -lctru -lm # list of directories containing libraries, this must be the top level containing # include and lib #--------------------------------------------------------------------------------- -LIBDIRS := $(CTRULIB) $(CURDIR)/../.. +LIBDIRS := $(CTRULIB) #--------------------------------------------------------------------------------- diff --git a/examples/textured_cube/Makefile b/examples/textured_cube/Makefile index 238a1f3..4be5cd3 100644 --- a/examples/textured_cube/Makefile +++ b/examples/textured_cube/Makefile @@ -54,7 +54,7 @@ LIBS := -lcitro3d -lctru -lm # list of directories containing libraries, this must be the top level containing # include and lib #--------------------------------------------------------------------------------- -LIBDIRS := $(CTRULIB) $(CURDIR)/../.. +LIBDIRS := $(CTRULIB) #---------------------------------------------------------------------------------