diff --git a/Makefile b/Makefile index c0c5d6f..0dd1c65 100644 --- a/Makefile +++ b/Makefile @@ -4,8 +4,8 @@ default: @/bin/echo -e "Usage:\n\tmake diet - compile with diet libc\n\tmake lib - compile with normal gnu libc\n\tmake test\n\tmake doc" -lib: - make -C src lib +glibc: + make -C src glibc diet: make -C src diet diff --git a/src/Makefile b/src/Makefile index 7e464c2..6447d44 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2,6 +2,8 @@ CFLAGS=-I../include -DDEBUG=2 -DPSYC_COMPILE_LIBRARY -g -O0 -Wall CC=cc # CC=clang +test -z "$DIET" || DIET=diet + S=packet.c misc.c parser.c match.c render.c memmem.c itoa.c variable.c O=packet.o misc.o parser.o match.o render.o memmem.o itoa.o variable.o @@ -9,12 +11,14 @@ default: @/bin/echo -e "Usage:\n\tmake diet - compile with diet libc\n\tmake lib - compile with normal gnu libc" diet: - diet ${CC} -static -c -Os $S ${CFLAGS} - diet ar rcs libpsyc.a $O + ${DIET} ${CC} -static -c -Os $S ${CFLAGS} + @test -d ../lib || mkdir ../lib + ${DIET} ar rcs ../lib/libpsyc.a $O -lib: $S +glibc: $S ${CC} -static -c -g -O0 $S -lc ${CFLAGS} - ar rcs libpsyc.a $O + @test -d ../lib || mkdir ../lib + ar rcs ../lib/libpsyc.a $O match: match.c ${CC} -o $@ -DDEBUG=4 -DCMDTOOL -DTEST $< @@ -25,4 +29,4 @@ itoa: itoa.c it: match clean: - rm -f $O + rm -f $O ../lib/libpsyc.a