#
# Copyright (c) 2003-2004 Linuxant inc.
#
# NOTE: The use and distribution of this software is governed by the terms in
# the file LICENSE, which is included in the package. You must read this and
# agree to these terms before using or distributing this software.
# 
TOP= ..

include $(TOP)/config.mak

SCRIPTS= $(CNXTTARGET)config $(CNXTTARGET)stop $(CNXTTARGET)modconflicts rc$(CNXTTARGET)
ifeq ($(CNXTDRIVER),hsf)
SCRIPTS+= $(CNXTTARGET)dcpd
endif

all: $(SCRIPTS)

$(CNXTTARGET)config.in: cnxtconfig.in
	ln -s $< $@

$(CNXTTARGET)stop.in: cnxtstop.in
	ln -s $< $@

$(CNXTTARGET)dcpd.in: cnxtdcpd.in
	ln -s $< $@

$(CNXTTARGET)modconflicts.in: cnxtmodconflicts.in
	ln -s $< $@

rc$(CNXTTARGET).in: rccnxt.in
	ln -s $< $@

install: $(SCRIPTS) $(CNXTSBINDIR) $(CNXTETCDIR)
	$(INSTALL) -m 700 $(SCRIPTS) $(CNXTSBINDIR)

$(CNXTSBINDIR) $(CNXTETCDIR):
	$(MKDIR) -p $@

uninstall:
	rm -f $(patsubst %, "$(CNXTSBINDIR)/%", $(SCRIPTS))

clean:
	rm -f $(patsubst %, %.in, $(SCRIPTS))
	rm -f $(SCRIPTS)
