2020-02-08 04:46:43 +00:00
|
|
|
BIN := ke
|
2020-02-13 01:37:28 +00:00
|
|
|
OBJS := main.o
|
2020-02-13 02:37:11 +00:00
|
|
|
INSTROOT := $(HOME)
|
|
|
|
VERSION := 0.9.2
|
2020-02-08 04:46:43 +00:00
|
|
|
|
2020-02-11 06:02:11 +00:00
|
|
|
LDFLAGS :=
|
2020-02-13 02:37:11 +00:00
|
|
|
CFLAGS := -pedantic -Wall -Werror -Wextra -O2 -std=c99 -g
|
|
|
|
CFLAGS += -fno-builtin-memmove -DKE_VERSION="\"$(VERSION)\""
|
2020-02-08 04:46:43 +00:00
|
|
|
|
|
|
|
.PHONY: all
|
2020-02-13 02:37:11 +00:00
|
|
|
all: build
|
2020-02-08 04:46:43 +00:00
|
|
|
|
2020-02-08 10:22:31 +00:00
|
|
|
.PHONY: build
|
|
|
|
build: $(BIN)
|
|
|
|
|
2020-02-13 02:37:11 +00:00
|
|
|
$(BIN): $(OBJS)
|
2020-02-11 17:52:49 +00:00
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS)
|
2020-02-08 04:46:43 +00:00
|
|
|
|
2020-02-13 02:37:11 +00:00
|
|
|
$(BIN).1.txt: $(BIN).1
|
|
|
|
mandoc -Tutf8 $(BIN).1 > $@
|
|
|
|
|
2020-02-08 04:46:43 +00:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2020-02-11 06:02:11 +00:00
|
|
|
rm -f $(BIN) $(OBJS) *.core keypress
|
2020-02-08 04:46:43 +00:00
|
|
|
|
|
|
|
.PHONY: run
|
|
|
|
run: $(BIN)
|
2020-02-08 07:07:59 +00:00
|
|
|
reset
|
2020-02-11 06:02:11 +00:00
|
|
|
./$(BIN) hello.txt
|
2020-02-08 04:46:43 +00:00
|
|
|
|
2020-02-11 01:01:21 +00:00
|
|
|
keypress: keypress.c
|
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ keypress.c
|
|
|
|
|
2020-02-11 08:30:21 +00:00
|
|
|
.PHONY: install
|
2020-02-13 02:37:11 +00:00
|
|
|
install: $(BIN) $(BIN).1
|
|
|
|
install -d $(INSTROOT)/bin/
|
|
|
|
install -d $(INSTROOT)/share/man/man1
|
|
|
|
install -C $(BIN) $(INSTROOT)/bin/
|
|
|
|
install -C $(BIN).1 $(INSTROOT)/share/man/man1/$(BIN).1
|
|
|
|
|
|
|
|
.PHONY: upload
|
|
|
|
upload: $(BIN).1.txt
|
|
|
|
scp main.c p.kyleisom.net:/var/www/sites/p/ke/$(BIN)_$(VERSION).c.txt
|
|
|
|
scp $(BIN).1.txt p.kyleisom.net:/var/www/sites/p/ke/$(BIN).1.txt
|
2020-02-11 08:30:21 +00:00
|
|
|
|
2020-02-13 01:11:32 +00:00
|
|
|
.PHONY: cloc
|
|
|
|
cloc:
|
2020-02-13 02:37:11 +00:00
|
|
|
cloc main.c
|
2020-02-13 01:11:32 +00:00
|
|
|
|
2020-02-08 04:46:43 +00:00
|
|
|
%.o: %.c
|