Skip to content

Commit 9c702b6

Browse files
committed
makefile dist + install + small changes
1 parent 65e35ce commit 9c702b6

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

Makefile

+14-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ CXXFLAGS = -O3 -Wall -Wextra -pedantic-errors -std=c++23 -I/usr/include
33
LDFLAGS = -L/usr/lib/x86_64-linux-gnu -lfmt -lboost_system -lboost_filesystem -lboost_program_options -lSQLiteCpp -lsqlite3
44

55
OBJS = src/main.o
6+
TARGET = ./dist/
67

7-
all: clean smile
8+
all: clean smile dist
89

910
smile: $(OBJS)
1011
$(CXX) -o $@ $(OBJS) $(LDFLAGS)
@@ -13,8 +14,17 @@ src/main.o: src/main.cpp
1314
$(CXX) $(CXXFLAGS) -c src/main.cpp -o src/main.o
1415

1516
clean:
16-
rm -f smile $(OBJS)
17+
rm -f smile $(OBJS) && rm -rf dist
1718
# rm -f smile $(OBJS) && rm -rf ~/.smile
1819

19-
run: smile
20-
./smile
20+
test: smile
21+
./smile --v --i ech
22+
23+
dist: smile
24+
@mkdir dist
25+
@cp -r ./initializer $(TARGET)
26+
@cp ./smile $(TARGET)
27+
28+
install: all
29+
@sudo mv $(TARGET) /usr/bin/smile
30+
@echo "Installation complete. Smile is available in /usr/bin"
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
command_not_found_handle() {
22

33
declare attempted_command="$1"
4-
smile -i $attempted_command
4+
/usr/bin/smile --i $attempted_command
55
return 0
66
}

src/main.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@ int main(int argc, char* argv[]) {
190190

191191
ensureCommandNotFoundHandler();
192192

193+
//TODO: enable database insertion for history if enabled
194+
195+
//TODO: order results by most similar characters from the start to give more appropriate results?
196+
193197
suggestCommands(vm, inputCommand, settings);
194198

195199
return 0;

0 commit comments

Comments
 (0)