CXX = cc -baout
CC  = cc -baout
INSTROOT=/Mastodon/Boot/mastodon

CFLAGS += -O2 -Wall -I../include -DACTUAL $(DEFS)
CXXFLAGS += -O2 -Wall -I../include -DACTUAL
LFLAGS += -L../lib/aout

LIBES=-lbasis -lnd -lpanel -lncurses

OBJECTS= util.o checkdisk.o \
           sniff.o media.o mountpar.o mousedetect.o loadandgo.o \
	   inventory.o logger.o configuration.o writemousecfg.o \
	   pcmcia.o packages.o constants.o par.o chores.o mount_disk.o

all production: installer

installer: loadandgo

loadandgo: $(OBJECTS) Makefile
	$(CC) -o loadandgo $(OBJECTS) $(LFLAGS) $(DEFS) $(LIBES)
ifndef DEFS
	strip loadandgo
endif

clean spotless:
	-rm -f *.o loadandgo core

install: loadandgo
	install -d $(INSTROOT)/sbin
	install -m 711 -o root -g root -c -s loadandgo $(INSTROOT)/sbin/init
	install -d $(INSTROOT)/usr/lib/help
	install -m 755 -o root -g root -c -d $(INSTROOT)/usr/lib/help
	install -m 444 -o root -g root -c  help/*.html $(INSTROOT)/usr/lib/help
	@touch $(INSTROOT)

checkdisk.o: checkdisk.c partition.h util.h part.h
checkforold.o: checkforold.c pathnames.h util.h part.h
loadandgo.o: loadandgo.c partition.h pathnames.h util.h part.h \
	     builddisk.h media.h
media.o: media.c util.h part.h media.h
mountpar.o: mountpar.c partition.h pathnames.h util.h part.h \
	     builddisk.h media.h
mousedetect.o: mousedetect.c util.h part.h
sniff.o: sniff.c partition.h pathnames.h util.h part.h builddisk.h \
	 media.h
util.o: util.c partition.h pathnames.h util.h part.h
