.PHONY: all CFLAGS += -g -Wall -Wpedantic CORE_OBJS = control.o reader.o config.o PLUGINS = reader_yhy.so reader_yhy.so: LDLIBS = -lyhy reader_yhy.so: LDFLAGS = -L. -Wl,-rpath . %.so: CFLAGS += -shared -fPIC %.so :: %.c %.h $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS) $(LDLIBS) nfcommander: LDLIBS = -ldl all: nfcommander $(PLUGINS) nfcommander: nfcommander.c nfcommander.h $(CORE_OBJS) clean: $(RM) nfcommander $(RM) $(CORE_OBJS) $(RM) $(PLUGINS)