Skip to content

Commit

Permalink
Merge pull request #5 from trapexit/romfs
Browse files Browse the repository at this point in the history
Add support for ROMFS and improve APIs
  • Loading branch information
trapexit committed Aug 28, 2022
2 parents a4319a7 + a7e8d13 commit 714a39a
Show file tree
Hide file tree
Showing 25 changed files with 680 additions and 1,511 deletions.
14 changes: 8 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ CXXFLAGS = $(OPT) -Wall -std=c++17 -MMD -MP
SRC_C = $(wildcard src/*.c)
SRC_CXX = $(wildcard src/*.cpp)

BUILDDIR = build/$(PLATFORM)
OBJ += $(SRC_C:src/%.c=build/$(PLATFORM)/%.c.o)
OBJ += $(SRC_CXX:src/%.cpp=build/$(PLATFORM)/%.cpp.o)

DEPS = $(OBJS:.o=.d)
DEP = $(OBJS:.o=.d)

all: $(OUTPUT)

Expand All @@ -29,15 +29,17 @@ strip: $(OUTPUT)
$(STRIP) --strip-all $(OUTPUT)

builddir:
mkdir -p build/$(PLATFORM)/
mkdir -p $(BUILDDIR)

build/$(PLATFORM)/%.c.o: src/%.c
$(BUILDDIR)/%.c.o: src/%.c
$(CC) $(CFLAGS) -c $< -o $@

build/$(PLATFORM)/%.cpp.o: src/%.cpp
$(BUILDDIR)/%.cpp.o: src/%.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@

clean:
rm -rfv build/

-include $(DEPS)
.PHONY: clean builddir

-include $(DEP)
5 changes: 4 additions & 1 deletion src/copy_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@ namespace util
do
{
bytes_to_read = std::min(buf.size(),bytes_to_write);

is_.read(&buf[0],bytes_to_read);

os_.write(&buf[0],is_.gcount());

bytes_to_write -= is_.gcount();
}
while(bytes_to_write > 0);
while(is_ && os_ && (bytes_to_write > 0));
}
}
1 change: 1 addition & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include <locale>


static
void
generate_version_argparser(CLI::App &app_)
Expand Down
Loading

0 comments on commit 714a39a

Please sign in to comment.