# be sure to uncomment the -DPRE_SOLARIS_2_5 for Solaris 2.3 and 2.4
# otherwise this module may cause unpredictable results
CFLAGS = -D_KERNEL  # -DPRE_SOLARIS_2_5
ASFLAGS = -P
CC = /opt/SUNWspro/bin/cc

load: sethostid
	/usr/sbin/modload ./sethostid

sethostid: sethostid.o
	/usr/ccs/bin/ld -r -o sethostid sethostid.o

sid: sid.c
	grep sethostid /etc/name_to_sysnum | sed 's/^/#define SYS_/' >sethostid.h
	$(CC) -o sid -I. sid.c

install: sethostid sid
	/usr/sbin/install -f /kernel/sys -m 0755 -u root -g sys ./sethostid
	/usr/sbin/install -f /usr/local/bin -m 0755 -u root -g sys ./sid

clean:
	rm -f core *.o sid sethostid sethostid.h
