# tag: Makefile for OpenBIOS plugins
#
# Copyright (C) 2003 Stefan Reinauer
#
# See the file "COPYING" for further information about
# the copyright and warranty status of this work.
#

PLUGINS = pci qt

QMAKE     = qmake
INCLUDES := -I$(TOPDIR)/include -I$(BUILDDIR)
LDFLAGS  := $(LDFLAGS) -rdynamic -ldl

include $(TOPDIR)/Rules.make

.PHONY: plugins

all: core loader plugins
	#strip -s $(BUILDDIR)/loader $(BUILDDIR)/plugin_*.so

core:
	echo -e "\nBuilding plugins"
	
loader.nostrip: loader.o
	cd $(BUILDDIR) && $(CC) $(LDFLAGS) -o $@ $^

loader: loader.nostrip
	cd $(BUILDDIR) && cp $< $@ && strip -R .note -R .comment $@

#
# Build plugins:
# 
subdir-list = $(patsubst %,_subdir_%,$(PLUGINS))
plugins: $(subdir-list)
$(subdir-list):
	@echo -n "  plugin $(patsubst _subdir_%,%,$@)...  "
	$(MAKE) -C plugin_$(patsubst _subdir_%,%,$@)
	@echo -e "\t\t\tok"

