auth_univ_orleans/Makefile

38 lines
937 B
Makefile
Raw Normal View History

2021-10-25 07:39:30 +00:00
.PHONY: all clean format
all: lib/libauthunivorleans.so lib/libauthunivorleans.a bin/test
2021-10-25 09:22:53 +00:00
CFLAGS += -Iinclude $(DEFINES) `pkg-config --cflags libcurl` -fPIC -Wall -Werror
2021-10-25 07:39:30 +00:00
FLAGS = -g
SRCS=$(wildcard src/*.c)
OBJS=$(SRCS:src/%.c=obj/%.o)
DEPS = $(OBJS:%.o=%.d)
-include $(DEPS)
clean:
rm -fr bin/* obj/* lib/*
format:
clang-format src/*.c -i
clang-format include/*.h -i
CC ?= $(CC)
obj/%.o: src/%.c
@mkdir -p $(@D)
2021-10-25 09:22:53 +00:00
$(CC) -c -MMD -o $@ $< $(CFLAGS) $(FLAGS)
2021-10-25 07:39:30 +00:00
2021-10-25 09:22:53 +00:00
lib/libauthunivorleans.so: obj/auth_univ_orleans.o obj/cookie_iterator.o obj/result.o
2021-10-25 07:39:30 +00:00
@mkdir -p $(@D)
2021-10-25 09:22:53 +00:00
$(CC) -fpic -shared $(CFLAGS) $(FLAGS) -o $@ $^ `pkg-config --libs libcurl` `pkg-config --libs tidy`
2021-10-25 07:39:30 +00:00
2021-10-25 09:22:53 +00:00
lib/libauthunivorleans.a: obj/auth_univ_orleans.o obj/cookie_iterator.o obj/result.o
2021-10-25 07:39:30 +00:00
@mkdir -p $(@D)
$(AR) -cr $@ $^
bin/test: obj/test.o lib/libauthunivorleans.a
@mkdir -p $(@D)
2021-10-25 09:22:53 +00:00
$(CC) -o $@ $^ $(CFLAGS) `pkg-config --libs libcurl` `pkg-config --libs tidy`