From f0afdc1296d24751ff7b83311e69609a3ae6cd9d Mon Sep 17 00:00:00 2001 From: Adam Saponara Date: Sun, 27 Feb 2022 17:41:06 -0500 Subject: [PATCH] add build rule for static lib --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 45116e3..15b389f 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ prefix?=/usr/local termbox_cflags:=-std=c99 -Wall -Wextra -pedantic -Wno-unused-result -g -O0 -D_XOPEN_SOURCE -D_DEFAULT_SOURCE $(CFLAGS) termbox_demos:=$(patsubst demo/%.c,demo/%,$(wildcard demo/*.c)) termbox_so:=libtermbox.so +termbox_a:=libtermbox.a termbox_o:=termbox.o termbox_h:=termbox.h @@ -17,6 +18,9 @@ $(termbox_o): $(termbox_h) $(termbox_so): $(termbox_o) $(CC) -shared $(termbox_o) -o $@ +$(termbox_a): $(termbox_o) + $(AR) rcs $@ $(termbox_o) + terminfo: awk -vg=0 'g==0{print} /BEGIN codegen h/{g=1; system("./codegen.sh h")} /END codegen h/{g=0; print} g==1{next}' termbox.h >termbox.h.tmp && mv -vf termbox.h.tmp termbox.h awk -vg=0 'g==0{print} /BEGIN codegen c/{g=1; system("./codegen.sh c")} /END codegen c/{g=0; print} g==1{next}' termbox.h >termbox.h.tmp && mv -vf termbox.h.tmp termbox.h -- 2.39.5