top_builddir = ../../..
top_srcdir = @top_srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@

BINDIR = $(DESTDIR)$(bindir)

VPATH = $(top_srcdir)/contrib/tool/mlcc

CC = @CC@
PROG = mlcc
CFLAGS = @CFLAGS@ @CPPFLAGS@
INSTALL = @INSTALL@

OBJECTS = data.o main.o comm.o \
 data_entry_string.o data_entry_bool.o data_entry_numeric.o \
 data_entry_color.o data_entry_radio.o

all: $(PROG)

$(PROG): $(OBJECTS)
	$(CC) -o $(PROG) $(OBJECTS) @LDFLAGS@

.SUFFIXES: .c.o

comm.o: comm.h
data.o: comm.h data.h
main.o: comm.h data.h

.c.o:
	$(CC) $(CFLAGS) -c $<

clean:
	rm -f $(OBJECTS) $(PROG) core core.* $(PROG).core 

$(BINDIR):
	mkdir -p $(BINDIR)

install: $(BINDIR)
	$(INSTALL) -m 755 $(PROG) $(BINDIR)

uninstall:
	rm -f $(BINDIR)/$(PROG)

mostlyclean:
	rm -f $(OBJECTS) core core.* $(PROG).core 

distclean: clean
	rm -f Makefile
