You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
422 B
24 lines
422 B
2 years ago
|
CC=gcc
|
||
|
DEFAULTCFLAGS=-Wall -Werror -O2
|
||
|
SRCDIR=src
|
||
|
LIBNAME=auxlib
|
||
|
BUILDDIR=build
|
||
|
BINDIR=bin
|
||
|
TESTDIR=testing
|
||
|
TESTBIN=test
|
||
|
|
||
|
lib:
|
||
|
$(CC) $(DEFAULTCFLAGS) -c $(SRCDIR)/*/*.c
|
||
|
|
||
|
mkdir -p $(BUILDDIR)
|
||
|
mv *.o $(BUILDDIR)
|
||
|
|
||
|
mkdir -p $(BINDIR)
|
||
|
ar rcs $(BINDIR)/$(LIBNAME).a $(BUILDDIR)/*.o
|
||
|
|
||
|
|
||
|
test:
|
||
|
$(CC) $(DEFAULTCFLAGS) $(TESTDIR)/*.c -o $(TESTDIR)/$(TESTBIN) && cd $(TESTDIR) && ./$(TESTBIN)
|
||
|
|
||
|
clear:
|
||
|
rm -rf $(BUILDDIR) $(BINDIR)
|