File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ CXXFLAGS = -std=c++20
2+ LDFLAGS =
3+ CPP_FILES := $(wildcard *.cpp)
4+ OBJ_FILES := $(CPP_FILES:.cpp=.o)
5+ OUTPUT_NAME = bin2cpp20
6+ DEPS := $(wildcard *.hpp)
7+
8+ %.o: %.cpp $(DEPS)
9+ $(CXX) $(CXXFLAGS) -c $< -o $@
10+
11+ $(OUTPUT_NAME): $(OBJ_FILES)
12+ $(CXX) $^ -o $@ $(LDFLAGS)
13+
14+ all: $(OUTPUT_NAME)
15+
16+ install: all
17+ cp $(OUTPUT_NAME) /usr/local/bin
18+
19+ clean:
20+ rm -f $(OUTPUT_NAME) $(OBJ_FILES)
21+
22+ .PHONY: all install clean
Original file line number Diff line number Diff line change 1+ # bin2cpp20
2+
3+ Unix Tool to Convert a stream to a C++20 array/vector/string
4+
5+ % cat * cpp | bin2cpp20 -i stdin -v variablename
6+
7+ % bin2cpp20 -i filename -o outputheader -v variable
8+
9+ % bin2cpp20 -i filename -o -v variable -s --sort
10+
11+ or arguments:
12+
13+ jared@iLostSideDead bin2cpp % bin2cpp20 -h
14+
15+ -h help
16+
17+ -i input file/stdin
18+
19+ -o output
20+
21+ -s string output
22+
23+ -v variable name
24+
25+ -z sort
26+
27+ --help help message
28+
29+ --input input file/stdin
30+
31+ --output output file
32+
33+ --string string output
34+
35+ --variable variable name
36+
37+ --sort sort string
38+
You can’t perform that action at this time.
0 commit comments