
CURDIR=main
all: main wrapper
OBJS =  linuxconf.o notice.o _dict.o
LDF = $(OPTDYNAMIC) -lm
LIBS_PROJECT = ../askrunlevel/askrunlevel.a ../netconf/netconf.a \
	../xconf/xconf.a ../translate/translate.a ../misc/misc.a \
	../dialog/dialog.a 
#LIBS =  $(LIBS_PROJECT) -lncurses $(CRYPTLIB)

LOCAL_INSTALLLADR=localinstall_ladr
LOCAL_INSTALL=localinstall
LOCAL_CLEAN=localclean
localclean:
	rm -f linuxconf linuxconf-wrapper

include ../rules.mak

proto:
	proto -Di386 -m0+ *.cc

# LNXMODULES allows one to link "statically" a module. This helps
# debugging. Nothing has to be changed in the module to link it
# this way. Statically linked module is against the licensing agreement
# of linuxconf but accepted to supply solutions to a.out users.
main: main.obt $(OBJS) $(LIBS_PROJECT)
	$(GPPLINK) $(LNXMODULES) $(LDF) -o linuxconf $< $(OBJS)\
		 `../utils/no_samples samples.o $(LIBS)` $(DBGLIBS)

OBJWRAPPER=../userconf/usercomng.o ../userconf/privi.o ../tlmp/*/*.o
wrapper: wrapper.o ../misc/module.o ../misc/libmodules.o _dict.o
	$(GPPLINK) wrapper.o ../misc/module.o ../misc/libmodules.o \
		_dict.o `../utils/no_samples samples.o $(OBJWRAPPER)` -o linuxconf-wrapper $(LDF) \
		../userconf/userconf.a ../fstab/fstab.a ../netconf/netconf.a \
		../askrunlevel/askrunlevel.a \
		-ldl $(CRYPTLIB) -L../lib -llinuxconf -lncurses


localinstall: msg.install install_bin

install_bin: html_version
	install -m 4755 $(INSTROOT) linuxconf $(BIN)/linuxconf
	mkdir -p $(USRBIN)
	install -s -m 755 $(INSTROOT) linuxconf-wrapper $(USRBIN)/linuxconf-wrapper
	ln -sf /bin/linuxconf $(BIN)/netconf
	ln -sf /bin/linuxconf $(BIN)/fsconf
	ln -sf /bin/linuxconf $(SBIN)/askrunlevel
	ln -sf /bin/linuxconf $(SBIN)/fixperm
	ln -sf /bin/linuxconf $(SBIN)/mailconf
	ln -sf /bin/linuxconf $(SBIN)/uucpconf
	ln -sf /bin/linuxconf $(SBIN)/dnsconf
	ln -sf /bin/linuxconf $(BIN)/userconf
	ln -sf /bin/linuxconf $(SBIN)/vregistry
	ln -sf /bin/linuxconf $(SBIN)/viewlog
	ln -sf /bin/linuxconf $(SBIN)/linuxconf
	mkdir -p $(ETC)/xinetd.d
	test -f $(ETC)/xinetd.d/linuxconf-web \
		||install -m 644 $(INSTROOT) linuxconf-xinetd $(ETC)/xinetd.d/linuxconf-web

# Update the file introweb.html with the current release number
html_version:
	(cd ../help.files/sources/main && make HELPDIR=$(LIB_LINUXCONF)/help.eng/main)

install-module:
	(cd ../modules && make install)

# Test program



