### Generated by Winemaker
SRCDIR                = .
SUBDIRS               =
DLLS                  =
EXES                  = fsthost_multi

CEXTRA                =
CEXTRA                += -m32 -fPIC -g -Wall -Wno-multichar -O2 -mfpmath=sse -msse
CEXTRA                += $(shell pkg-config --cflags libxml-2.0 jack)
CXXEXTRA              = -mno-cygwin
RCEXTRA               =
INCLUDE_PATH          = -I. -I/usr/include -I/usr/include -I/usr/include/wine -I/usr/include/wine/windows
INCLUDE_PATH          += -I/usr/local/include/wine -I/usr/local/include/wine/windows
DLL_PATH              =
LIBRARY_PATH          = 
LIBRARIES             =
DESTDIR               =
PREFIX                = /usr
LIB_INST_PATH         = 
BIN_INST_PATH         = 

### multi.exe sources and settings
multi_MODULE        = fsthost_multi
multi_C_SRCS        = $(wildcard fst/*.c) $(wildcard xmldb/*.c) unused/multi.c
multi_LDFLAGS       = -m32 -mwindows $(shell pkg-config --libs libxml-2.0 jack)
multi_DLL_PATH      =
multi_DLLS          = 
multi_LIBRARY_PATH  =
multi_LIBRARIES     =
multi_OBJS          = $(multi_C_SRCS:.c=.o)

### Global source lists
C_SRCS                = $(multi_C_SRCS)
CXX_SRCS              = $(multi_CXX_SRCS)
RC_SRCS               = $(multi_RC_SRCS)

### Tools
CC = gcc
CXX = g++
LINK = winegcc
RC = wrc
WINEBUILD = winebuild

### Generic targets
all: $(SUBDIRS) $(DLLS:%=%.so) $(EXES:%=%)

### Build rules

.PHONY: all clean dummy install

$(SUBDIRS): dummy
	@cd $@ && $(MAKE)

# Implicit rules

.SUFFIXES: .cpp .rc .res
DEFINCL = $(INCLUDE_PATH) $(DEFINES) $(OPTIONS)

.c.o:
	$(CC) -c $(CFLAGS) $(CEXTRA) $(DEFINCL) -o $@ $<

.cpp.o:
	$(CXX) -c $(CXXFLAGS) $(CXXEXTRA) $(DEFINCL) -o $@ $<

.cxx.o:
	$(CXX) -c $(CXXFLAGS) $(CXXEXTRA) $(DEFINCL) -o $@ $<

.rc.res:
	$(RC) $(RCFLAGS) $(RCEXTRA) $(DEFINCL) -fo$@ $<

# Rules for cleaning

CLEAN_FILES = *.dbg.c y.tab.c y.tab.h lex.yy.c core *.orig *.rej multi.exe* \\\#*\\\# *~ *% .\\\#*

clean:: $(SUBDIRS:%=%/__clean__) $(EXTRASUBDIRS:%=%/__clean__)
	$(RM) $(CLEAN_FILES) $(RC_SRCS:.rc=.res) $(C_SRCS:.c=.o) $(CXX_SRCS:.cpp=.o)
	$(RM) $(DLLS:%=%.dbg.o) $(DLLS:%=%.so)
	$(RM) $(EXES:%=%.dbg.o) $(EXES:%=%.so) $(EXES:%.exe=%)

$(SUBDIRS:%=%/__clean__): dummy
	cd `dirname $@` && $(MAKE) clean

$(EXTRASUBDIRS:%=%/__clean__): dummy
	-cd `dirname $@` && $(RM) $(CLEAN_FILES)

### Target specific build rules
DEFLIB = $(LIBRARY_PATH) $(LIBRARIES) $(DLL_PATH)

$(multi_MODULE): $(multi_OBJS)
	$(LINK) -o $@ $(multi_OBJS) $(multi_LIBRARY_PATH) $(DEFLIB) $(multi_DLLS:%=-l%) $(multi_LIBRARIES:%=-l%) $(multi_LDFLAGS)
