# SPDX-License-Identifier: GPL-2.0
SRC := $(wildcard *.c)
OBJ := $(patsubst %.c,%.o, $(SRC))

.PHONY: static_lib shared_lib clean all
.DEFAULT_GOAL := all

%.o: %.c
	@echo $< $@
	gcc -rdynamic -fPIC -o $@ -c $<

static_lib: $(OBJ)
	ar rcs libasn1.a $^

shared_lib: $(OBJ)
	$(CC) -Wall -shared -o libasn1.so $^

all: static_lib shared_lib

clean:
	rm -rf $(OBJ) libasn1.so libasn1.a
