pool/stratum/iniparser/test/Makefile
Ralph S. (Coolguy3289) 5b34545a3b Update iniparser
2020-01-20 00:49:35 -05:00

35 lines
689 B
Makefile

CC ?= gcc
ifndef V
QUIET_CC = @echo "CC $@";
QUIET_MAKE_TESTS = @echo "GN Alltests.c";
endif
DEPS = $(shell ls ../src/*.[ch])
SRC = $(shell ls *.c | sed 's/AllTests.c//')
OBJ = $(SRC:.c=.o)
INCLUDE = -I../src
CFLAGS += -pipe -ansi -pedantic -Wall -Wextra -g
LDFLAGS +=
all: check
check: testrun
@./testrun
testrun: AllTests.o $(OBJ)
$(QUIET_CC)$(CC) -o $@ AllTests.o $(OBJ) $(LDFLAGS)
AllTests.o: $(OBJ)
$(QUIET_MAKE_TESTS)./make-tests.sh > AllTests.c
$(QUIET_CC)$(CC) -c -o AllTests.o AllTests.c $(CFLAGS) $(INCLUDE)
%.o: %.c $(DEPS)
$(QUIET_CC)$(CC) -c -o $@ $< $(CFLAGS) $(INCLUDE)
clean veryclean:
rm -rf AllTests.c
rm -rf $(OBJ) AllTests.o
rm -rf testrun