
# SimParm: Simple and flexible C++ configuration framework
# Copyright (C) 2007 Australian National University
# 
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
# 
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
# 
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
# 
# Contact:
# Kevin Pulo
# kevin.pulo@anu.edu.au
# Leonard Huxley Bldg 56
# Australian National University, ACT, 0200, Australia


JAVA_OBJS  = ConfigSet.class
JAVA_OBJS += ConfigEntry.class
JAVA_OBJS += ConfigEntryTextbox.class
JAVA_OBJS += ConfigEntryString.class
JAVA_OBJS += ConfigEntryNumber.class
JAVA_OBJS += ConfigEntryDouble.class
JAVA_OBJS += ConfigEntryLong.class
JAVA_OBJS += ConfigEntryCheckbox.class
JAVA_OBJS += ConfigEntryBool.class
JAVA_OBJS += ConfigEntryButton.class
JAVA_OBJS += ConfigEntryTrigger.class
JAVA_OBJS += ConfigEntryChooser.class
JAVA_OBJS += ConfigEntryChoice.class
JAVA_OBJS += ConfigEntryDivider.class
JAVA_OBJS += Twiddler.class


JARFILE = twiddler.jar

SCRIPTS = twiddler

all: $(JARFILE) $(SCRIPTS)

$(JARFILE): $(JAVA_OBJS)
	$(JAR) cfm $@ manifest *.class

$(JAVA_OBJS): %.class: %.java
	$(JAVAC) $^

$(SCRIPTS): %: %.in
	sed -e 's,SHARE_PREFIX,$(SHARE_PREFIX),g' $< > $@

install:
	$(INSTALL) -m 0755 -d $(SHARE_PREFIX)
	$(INSTALL) -m 0755 -d $(BIN_PREFIX)
	$(INSTALL) -m 0644 $(JARFILE) $(SHARE_PREFIX)
	$(INSTALL) -m 0755 $(SCRIPTS) $(BIN_PREFIX)

clean:
	$(RM) -f $(JARFILE) $(JAVA_OBJS) *.class $(SCRIPTS)


