ctpv/Makefile

58 lines
1.0 KiB
Makefile
Raw Normal View History

2022-05-22 09:55:04 +02:00
PREFIX := /usr/local
BINPREFIX := $(PREFIX)/bin
SRC := $(wildcard *.c)
OBJ := $(SRC:.c=.o)
DEP := $(OBJ:.o=.d)
PRE := $(wildcard prev/*.sh)
GEN := gen/prev/scripts.h gen/server.h gen/helpers.h
2022-05-22 09:55:04 +02:00
CFLAGS += -Os -MD -Wall -Wextra -Wno-unused-parameter
LDFLAGS += -lmagic -lcrypto
2022-05-22 09:55:04 +02:00
all: ctpv
options:
@echo "CC = $(CC)"
@echo "CFLAGS = $(CFLAGS)"
@echo "LDFLAGS = $(LDFLAGS)"
2022-05-25 23:57:50 +02:00
install: ctpv ctpvclear
2022-05-22 09:55:04 +02:00
install -d $(BINPREFIX)
2022-05-25 23:57:50 +02:00
install $^ $(BINPREFIX)
2022-05-22 09:55:04 +02:00
uninstall:
2022-05-26 01:48:27 +02:00
$(RM) $(BINPREFIX)/ctpv $(BINPREFIX)/ctpvclear
2022-05-22 09:55:04 +02:00
clean:
$(RM) ctpv $(OBJ) $(DEP) $(GEN)
$(MAKE) -C embed clean
make_embed:
$(MAKE) -C embed
ctpv: $(OBJ)
ctpv.c: $(GEN)
gen/prev/scripts.h: $(PRE) embed/embed
2022-05-22 09:55:04 +02:00
@mkdir -p $(@D)
embed/embed -p prev_scr_ $(PRE) > $@
2022-05-22 09:55:04 +02:00
gen/server.h: clear.sh end.sh embed/embed
2022-05-25 23:57:50 +02:00
@mkdir -p $(@D)
embed/embed -p scr_ clear.sh end.sh > $@
gen/helpers.h: helpers.sh embed/embed
@mkdir -p $(@D)
embed/embed -p scr_ helpers.sh > $@
2022-05-25 23:57:50 +02:00
2022-05-22 09:55:04 +02:00
embed/embed: make_embed
@:
-include $(DEP)
.PHONY: all options install uninstall clean make_embed
.DELETE_ON_ERROR: