#
# $Id: Makefile,v 1.4 2007/04/04 00:00:00 root Exp $
#

CFLAGS	= -fbasic-block-address-map -funique-internal-linkage-names -flto -ffast-math -Werror -O3 -fPIE -fomit-frame-pointer -funroll-loops \
		  -fforce-addr -falign-functions=4 -msse4a
TTAENC	= ttaenc
INSDIR	= /usr/bin

ttaenc: $(patsubst %.c, %.o, $(wildcard *.c))
	mold -run clang-21 $^ -o $@ $(CFLAGS)

%.o:	%.c
	clang-21 -c $(CFLAGS) $<

install:
	[ -d "$(INSDIR)" ] || mkdir $(INSDIR)
	if [ -n "$(TTAENC)" ]; then \
		strip $(TTAENC) ; \
		install -m 755 $(TTAENC) $(INSDIR) ; \
	fi

remove:
	rm -f $(INSDIR)/$(TTAENC)

clean:
	rm -f *.o $(TTAENC)
