#
# for gcc uncomment the following two lines
#CC = gcc
#GNULIB=/usr/local/lib/gcc-gnulib

LDFLAGS = -s
SHAREDLIB=/lib/crt0s.o /lib/shlib.ifile

CFLAGS = -O

NAME = moire
DIR = /usr/games
SRC = moire.c line.c prewinit.c
OBJ = moire.o line.o prewinit.o

$(NAME): $(OBJ)
	$(LD) $(LDFLAGS) $(SHAREDLIB) $(OBJ) $(GNULIB) -o moire 

install:
	mv $(NAME) $(DIR)/$(NAME)
	chgrp bin  $(DIR)/$(NAME)
	chown bin  $(DIR)/$(NAME)

lint: $(SRC)
	lint -x -u $(SRC)

# use gcc as a version of lint (for ANSI C compatability)
#   because the standard include files use #sccs
#   do not be pedantic about pre-processing
pedantic: $(SRC)
	gcc -ansi -E moire.c > junk.c 
	gcc -ansi -pedantic -S junk.c
	gcc -ansi -E line.c > junk.c 
	gcc -ansi -pedantic -S junk.c
	gcc -ansi -E prewinit.c > junk.c 
	gcc -ansi -pedantic -S junk.c
	rm junk.c junk.s


clean:
	rm -f $(OBJ) moire
