<commit_before># makefile for POSIX library for Lua

# change these to reflect your Lua installation
#LUA= /tmp/lhf/lua-5.0
LUA= /pkg/lua-5.1.1-LR1
LUAINC= $(LUA)/include
LUALIB= $(LUA)/lib
LUABIN= $(LUA)/bin

# no need to change anything below here
CPPFLAGS= -fPIC $(INCS) $(WARN)
#LDFLAGS= -O2
WARN= -pedantic -Wall
INCS= -I$(LUAINC)

MYNAME= posix
MYLIB= $(MYNAME)

OBJS= l$(MYLIB).o

T= $(MYLIB).so

all:	test

test:	$T
	$(LUABIN)/lua test.lua

$T:	$(OBJS)
	$(CC) $(LDFLAGS) -o $@ -shared $(OBJS)

$(OBJS): modemuncher.c

tree:	$T
	$(LUABIN)/lua -l$(MYNAME) tree.lua .

clean:
	rm -f $(OBJS) $T core core.* a.out

x:
	@echo "$(MYNAME) library:"
	@grep '},' $(MYLIB).c | cut -f2 | tr -d '{",' | sort | column

xx:
	@echo "$(MYNAME) library:"
	@fgrep '/**' $(MYLIB).c | cut -f2 -d/ | tr -d '*' | sort | column

# distribution

FTP= $(HOME)/public/ftp/lua
D= $(MYNAME)
A= $(MYLIB).tar.gz
TOTAR= Makefile,README,$(MYLIB).c,$(MYNAME).lua,test.lua,modemuncher.c,tree.lua

tar:	clean
	tar zcvf $A -C .. $D/{$(TOTAR)}

distr:	tar
	mv $A $(FTP)

diff:	clean
	tar zxf $(FTP)/$A
	diff $D .

.stamp:	$(FTP)/$A
	touch --reference=$(FTP)/$A $@

# eof<commit_msg>cleaned up Makefile<commit_after># makefile for POSIX library for Lua

# change these to reflect your Lua installation
PREFIX=		/usr/local
LUAVERSION=	5.1
LUAINC= 	$(PREFIX)/include
LUALIB= 	$(PREFIX)/lib/lua/$(LUAVERSION)
LUABIN= 	$(PREFIX)/bin

# other executables
TAR=		tar
LUA=		lua
INSTALL=	install

# no need to change anything below here
PACKAGE=	luaposix
LIBVERSION=	1
VERSION=	$(LUAVERSION).$(LIBVERSION)

SRCS=		lposix.c modemuncher.c test.lua tree.lua
EXTRADIST=	Makefile README ChangeLog
DISTFILES=	$(SRCS) $(EXTRADIST)
DISTDIR=	$(PACKAGE)-$(VERSION)
TARGZ=		$(PACKAGE)-$(VERSION).tar.gz

CPPFLAGS=	-fPIC $(INCS) $(WARN)
WARN=		-pedantic -Wall
INCS=		-I$(LUAINC)

MYNAME=		posix
MYLIB= 		$(MYNAME)

OBJS=		l$(MYLIB).o

T= 		$(MYLIB).so

# targets
phony += all
all:	test

phony += test
test:	$T
	$(LUA) test.lua

$T:	$(OBJS)
	$(CC) $(LDFLAGS) -o $@ -shared $(OBJS)

$(OBJS): modemuncher.c

phony += tree
tree:	$T
	$(LUA) -l$(MYNAME) tree.lua .

phony += clean
clean:
	rm -f $(OBJS) $T core core.* a.out $(TARGZ)

phony += install
install: $T
	$(INSTALL) -D $T $(DESTDIR)/$(LUALIB)/$T
	
phony += show-funcs
show-funcs:
	@echo "$(MYNAME) library:"
	@fgrep '/**' l$(MYLIB).c | cut -f2 -d/ | tr -d '*' | sort

# distribution

phony += distdir
distdir: $(DISTFILES)
	if [ -d "$(DISTDIR)" ]; then	\
		rm -r "$(DISTDIR)";	\
	fi
	mkdir "$(DISTDIR)"
	cp -a $(DISTFILES) "$(DISTDIR)/"


phony += tar
tar:	distdir	
	$(TAR) zcf $(TARGZ) $(DISTDIR)
	rm -r $(DISTDIR)

phony += dist
dist:	tar

.PHONY: $(phony)
# eof
{'fraction_non_alphanumeric': 0.20300187617260787, 'fraction_numerical': 0.004878048780487805, 'mean_word_length': 3.7437722419928825, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7328936', 'n_tokens_mistral': 1251, 'n_tokens_neox': 1202, 'n_words': 312}