# This is a modified make file for CHORD for OS/2

# Select the required paper size for your printer
PAPERSIZE = US
#PAPERSIZE = A4

# If your system does not have a getopt fonction, uncomment the next line
#GETOPT = getopt.o

# Use a ansi or K&R compiler
CC = gcc 
CFLAGS = -D$(PAPERSIZE) -g -O2 -m486

# I commented out everything having something to do with make install,
# known this is not necessary nor conform to the OS/2 directory structure

# where to put the resulting program
#BINDIR = /usr/local/bin

# where to put the man page
#MANDIR = /usr/man
#MANEXT = l

# You should not have to change anything below this line

# name of the program
PROGRAMS = chord.exe  a2crd.exe

INCL = chord.h getopt.h patchlevel.h
SRC = common.c xpose.c iso.c toc.c chord.c grid.c getopt.c chord.man Makefile a2crd.c
OBJ = common.o xpose.o iso.o toc.o chord.o grid.o ${GETOPT}
SONGS = songs/space-oddity songs/heaven songs/everybody-hurts
DOCS = README chord_guide.ps license.txt a2crd.man a2crd.txt
RELNAME = chord36

all: $(PROGRAMS)

chord.exe : $(OBJ) Makefile
	$(CC) $(CFLAGS) -o $@ $(OBJ)

a2crd.exe: a2crd.o Makefile
	$(CC) $(CFLAGS) -o $@ a2crd.o common.o
	
chord.o    : chord.h
common.o   : chord.h
grid.o     : chord.h
xpose.o	   : chord.h
getopt.o   : getopt.h
toc.o	   : chord.h

#install : all
#	cp $(PROGRAMS) $(BINDIR)
#	rm -f $(MANDIR)/cat$(MANEXT)/chord.$(MANEXT)
#	cp chord.man $(MANDIR)/man$(MANEXT)/chord.$(MANEXT)
#	chmod 666 $(MANDIR)/man$(MANEXT)/chord.$(MANEXT)
#	Cp a2crd.man $(MANDIR)/man$(MANEXT)/a2crd.$(MANEXT)
#	chmod 666 $(MANDIR)/man$(MANEXT)/a2crd.$(MANEXT)
	
# Note that also shar, tar and lint are not necessary. I left them
# uncommented just in case you want to play with them!

shar : $(SRC)
	rm -f $(RELNAME).part*
	shar -F -L 60 -o $(RELNAME).part $(SRC) $(INCL) $(SONGS) $(DOCS)

tar : $(SRC)
	tar cvf $(RELNAME).tar $(SRC) $(INCL) $(SONGS) $(DOCS)
	rm $(RELNAME).tar.Z
	compress -v $(RELNAME).tar

lint : $(SRC)
	lint $(SRC)

clean:
	rm -f core *.o *.exe 

	
