feat: first commit

This commit is contained in:
Lorenzo Torres 2026-01-25 10:20:10 +01:00
commit 701734097e
13 changed files with 2655 additions and 0 deletions

53
Makefile Normal file
View file

@ -0,0 +1,53 @@
# xcc - eXtended C compiler
# See LICENSE file for copyright and license details.
include config.mk
SRC = xcc.c utils.c lexer.c
HDR = config.def.h utils.h lexer.h
OBJ = ${SRC:.c=.o}
all: options xcc
options:
@echo xcc build options:
@echo "CFLAGS = ${CFLAGS}"
@echo "LDFLAGS = ${LDFLAGS}"
@echo "CC = ${CC}"
.c.o:
${CC} -c ${CFLAGS} $<
${OBJ}: config.mk
xcc: ${OBJ}
${CC} -o $@ ${OBJ} ${LDFLAGS}
clean:
rm -f xcc ${OBJ} xcc-${VERSION}.tar.gz
dist: clean
mkdir -p xcc-${VERSION}
cp -R LICENSE Makefile README config.mk\
xcc.1 ${HDR} ${SRC} xcc-${VERSION}
tar -cf xcc-${VERSION}.tar xcc-${VERSION}
gzip xcc-${VERSION}.tar
rm -rf xcc-${VERSION}
install: all
mkdir -p ${DESTDIR}${PREFIX}/bin
cp -f xcc ${DESTDIR}${PREFIX}/bin
chmod 755 ${DESTDIR}${PREFIX}/bin/xcc
mkdir -p ${DESTDIR}${MANPREFIX}/man1
sed "s/VERSION/${VERSION}/g" < xcc.1 > ${DESTDIR}${MANPREFIX}/man1/xcc.1
chmod 644 ${DESTDIR}${MANPREFIX}/man1/xcc.1
uninstall:
rm -f ${DESTDIR}${PREFIX}/bin/xcc\
${DESTDIR}${MANPREFIX}/man1/xcc.1
graph: clean all
./xcc > graph.dot
dot -Tpdf graph.dot > graph.pdf
zathura ./graph.pdf
.PHONY: all options clean dist install uninstall