#
# $Id: make_rim_linux,v 1.1 2002/09/27 15:25:25 rath Exp $
#
CC=gcc
TARGET=roller_rim
OBJS=roller_rim.o $(TABLES:.c=.o) roller_table_mgr.o roller_plot.o
TABLES=roller_tables.c
PLOT=roller_plot.eps
PLSOURCES=Roller.pm table_maker.pl plot_maker.pl
PLUGIN=$(TARGET).pd_linux
INCLUDE=-I/usr/local/include
OPTIM = -O2 -funroll-loops -fomit-frame-pointer
DEBUG = -g
PROFILE = 
PARANOID = -Wall -W -Wshadow -Wstrict-prototypes -Werror \
    -Wno-unused -Wno-parentheses -Wno-switch
DEFINES=-DHAS_POPEN
CFLAGS= $(INCLUDE) $(DEFINES) $(OPTIM) $(PARANOID) $(PROFILE) $(XCFLAGS)

all:	$(OBJS) $(PLOT) $(PLUGIN)

$(PLUGIN):	$(OBJS)
	$(LD) $(LDFLAGS) -export_dynamic -shared -o $@ $(OBJS) -lm -lc

plot:	$(PLOT)

$(PLOT):	$(PLSOURCES)
	./plot_maker.pl > $@

roller_tables.c:	$(PLSOURCES)
	./table_maker.pl > $@

clean:
	$(RM) $(OBJS) $(PLOT) $(PLUGIN) $(TABLES)

$(OBJS):	roller.h
