xref: /libCEED/Makefile (revision 4859b599394518f4b60a30acb453965a3e97ed73)
1CFLAGS = -std=c99 -Wall -Wextra -Wno-unused-parameter -fPIC
2CFLAGS += $(if $(NDEBUG),-O2,-g)
3CPPFLAGS = -I.
4
5libfeme := libfeme.so
6libfeme.c := $(wildcard feme*.c)
7tests.c   := $(wildcard t[0-9][0-9]-*.c)
8tests     := $(tests.c:%.c=%)
9
10$(libfeme) : $(libfeme.c:%.c=%.o)
11	$(CC) $(LDFLAGS) -shared -o $@ $^ $(LDLIBS)
12
13$(tests) : $(libfeme)
14$(tests) : LDFLAGS += -Wl,-rpath,. -L.
15t% : t%.c $(libfeme)
16
17run-t% : t%
18	@./tap.sh $<
19
20test : $(tests:%=run-%)
21
22.PHONY: clean print
23clean :
24	$(RM) *.o $(libfeme) $(tests.c:%.c=%)
25
26print :
27	@echo $(VAR)=$($(VAR))
28