# Change INSTALL if you want the binaries to be installed somewhere else
# where the bin and usr/bin directories exist. The default is /, so
# the files will end at:
#
# /bin/login
# /usr/bin/grppasswd
# /usr/bin/addgroup
# /usr/bin/pwchk

INSTALL = /

PROF    = -g0 -O2
CFLAGS  = $(PROF) -Wall
LDFLAGS = $(PROF) 

OBJECTS = common.o grppasswd.o pwchk.o
HEADERS = common.h pwchk.h grppasswd.h
TARGETS = grppasswd pwchk addgroup
MD5SUM  = *.c *.h Makefile grplogin/*.c grplogin/*.h grplogin/Makefile License
		
all: $(TARGETS)
	cd grplogin && make


$(OBJECTS): $(HEADERS)

grppasswd: 	grppasswd.o common.o
pwchk: 		pwchk.o common.o
addgroup:	grppasswd
		ln -sf grppasswd addgroup
clean:
		rm -f *.o grplogin/*.o $(TARGETS) grplogin/login
install:
		install --strip -o root -g bin grplogin/login $(INSTALL)/bin
	 	install --strip -o root -g bin pwchk $(INSTALL)/usr/bin
		install --strip -o root -g bin grppasswd $(INSTALL)/usr/bin
		ln -sf $(INSTALL)/usr/bin/grppasswd $(INSTALL)/usr/bin/addgroup
check:       
	        md5sum $(MD5SUM) && (md5sum $(MD5SUM) | md5sum)
		
