<commit_before>prefix=/usr/local
bindir=$(prefix)/bin
includedir=$(prefix)/include
libdir=$(prefix)/lib
sysconfdir=$(prefix)/etc

LIBSRC = $(sort $(wildcard src/*.c))
DEMOSRC = $(sort $(wildcard src/demo/*.c))

SRCS = $(LIBSRC) $(DEMOSRC)
OBJS = $(SRCS:.c=.o)
LIBOBJS = $(LIBSRC:.c=.o)
DEMOOBJS = $(DEMOSRC:.c=.o)

HEADERS = src/termbox.h
ALL_INCLUDES = $(HEADERS)

ALL_LIBS=libtermbox.a
ALL_DEMOS=keyboard_demo

CFLAGS=-fPIC -O0 -g -std=gnu99 -D_GNU_SOURCE

AR      = $(CROSS_COMPILE)ar
RANLIB  = $(CROSS_COMPILE)ranlib


-include config.mak

BUILDCFLAGS=$(CFLAGS)

all: $(ALL_LIBS) $(ALL_DEMOS)

install: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(ALL_INCLUDES:include/%=$(DESTDIR)$(includedir)/%)

clean:
	rm -f $(ALL_LIBS)
	rm -f $(ALL_DEMOS)
	rm -f $(OBJS)

%.o: %.c
	$(CC) $(BUILDCFLAGS) -c -o $@ $<

libtermbox.a: $(LIBOBJS)
	rm -f $@
	$(AR) rc $@ $(LIBOBJS)
	$(RANLIB) $@

keyboard_demo: $(OBJS)
	$(CC) $(LDFLAGS) -o $@ $(OBJS)

$(DESTDIR)$(libdir)/%.a: %.a
	install -D -m 755 $< $@<commit_msg>added shared lib target to Makefile<commit_after>prefix=/usr/local
bindir=$(prefix)/bin
includedir=$(prefix)/include
libdir=$(prefix)/lib
sysconfdir=$(prefix)/etc

LIBSRC = $(sort $(wildcard src/*.c))
DEMOSRC = $(sort $(wildcard src/demo/*.c))

SRCS = $(LIBSRC) $(DEMOSRC)
OBJS = $(SRCS:.c=.o)
LIBOBJS = $(LIBSRC:.c=.o)
DEMOOBJS = $(DEMOSRC:.c=.o)

HEADERS = src/termbox.h
ALL_INCLUDES = $(HEADERS)

SHARED_LIBS=libtermbox.so
ALL_LIBS=libtermbox.a
ALL_DEMOS=keyboard_demo

CFLAGS=-fPIC -O0 -g -std=gnu99 -D_GNU_SOURCE

AR      = $(CROSS_COMPILE)ar
RANLIB  = $(CROSS_COMPILE)ranlib


-include config.mak

BUILDCFLAGS=$(CFLAGS)

all: $(ALL_LIBS) $(ALL_DEMOS) $(SHARED_LIBS)

install: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(ALL_INCLUDES:include/%=$(DESTDIR)$(includedir)/%)

clean:
	rm -f $(ALL_LIBS)
	rm -f $(ALL_DEMOS)
	rm -f $(OBJS)

%.o: %.c
	$(CC) $(BUILDCFLAGS) -c -o $@ $<

libtermbox.a: $(LIBOBJS)
	rm -f $@
	$(AR) rc $@ $(LIBOBJS)
	$(RANLIB) $@

libtermbox.so: $(LIBOBJS)
	gcc -shared -o $(SHARED_LIBS) $(LIBOBJS)

keyboard_demo: $(OBJS)
	$(CC) $(LDFLAGS) -o $@ $(OBJS)

$(DESTDIR)$(libdir)/%.a: %.a
	install -D -m 755 $< $@
{'fraction_non_alphanumeric': 0.22586691658856609, 'fraction_numerical': 0.005623242736644799, 'mean_word_length': 4.7238605898123325, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5224528', 'n_tokens_mistral': 1042, 'n_tokens_neox': 988, 'n_words': 178}