Files
libsam3/Makefile

48 lines
909 B
Makefile
Raw Permalink Normal View History

2016-12-18 15:29:31 +13:00
CFLAGS := -Wall -g -O2 -std=gnu99
SRCS := \
src/libsam3/libsam3.c \
src/libsam3a/libsam3a.c
TESTS := \
src/ext/tinytest.c \
test/test.c \
test/libsam3/test_b32.c
2017-12-28 09:21:16 -05:00
LIB_OBJS := ${SRCS:.c=.o}
TEST_OBJS := ${TESTS:.c=.o}
OBJS := ${LIB_OBJS} ${TEST_OBJS}
LIB := libsam3.a
all: build check
2016-12-18 15:29:31 +13:00
check: libsam3-tests
./libsam3-tests
2017-12-28 09:21:16 -05:00
build: ${LIB}
${LIB}: ${LIB_OBJS}
${AR} -sr ${LIB} ${LIB_OBJS}
libsam3-tests: ${TEST_OBJS} ${LIB}
2016-12-18 15:29:31 +13:00
${CC} $^ -o $@
clean:
rm -f libsam3-tests ${LIB} ${OBJS} examples/sam3/samtest
2016-12-18 15:29:31 +13:00
# TODO: this does not work yet because I don't know how to do it.
boost:
gcc -Werror -Wall -Wextra -Wno-unused-parameter -std=c++11 -g -lboost_system -lboost_thread -lpthread examples/boost/boost.cpp -o boost
2016-12-18 15:29:31 +13:00
%.o: %.c Makefile
${CC} ${CFLAGS} $(LDFLAGS) -c $< -o $@
2019-02-11 23:41:46 -05:00
fmt:
find . -name '*.c' -exec clang-format -i {} \;
find . -name '*.h' -exec clang-format -i {} \;
2020-11-18 12:26:15 -05:00
info:
@echo $(AR)