add make(1)

seems fairly stable!
This commit is contained in:
Kyle Isom 2020-02-11 00:30:21 -08:00
parent 93fd4e8bc7
commit 464de25980
2 changed files with 13 additions and 2 deletions

View File

@ -25,5 +25,9 @@ run: $(BIN)
keypress: keypress.c
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ keypress.c
.PHONY: install
install: $(BIN)
cp $(BIN) $(HOME)/bin/
%.o: %.c
$(CC) $(CFLAGS) -c $@ $<

View File

@ -237,7 +237,7 @@ insert_row(int at, char *s, size_t len)
if (at < editor.nrows) {
memmove(&editor.row[at+1], &editor.row[at],
sizeof(erow) * (editor.rows - at + 1));
sizeof(erow) * (editor.nrows - at + 1));
}
editor.row[at].size = len;
@ -835,6 +835,13 @@ process_kcommand(int16_t c)
case 'f':
editor_find();
break;
case 'm':
if (system("make") != 0) {
editor_set_status("process failed: %s", strerror(errno));
} else {
editor_set_status("make: ok");
}
break;
}
editor.dirtyex = 1;