include config.mk

all: lwl

lwl: main.c term.o text.o state.o draw.o config.h
	$(CC) main.c text.o term.o state.o draw.o -o lwl

install: lwl
	cp -f lwl $(PREFIX)/bin
	mkdir -p $(MANPREFIX)/man1
	cp -f lwl.1 $(MANPREFIX)/man1

uninstall:
	rm -f $(PREFIX)/bin/lwl
	rm -f $(MANPREFIX)/man1/lwl.1

clean:
	rm -f term.o draw.o state.o text.o lwl

term.o: term.c term.h config.h
	$(CC) term.c -c -o term.o

state.o: state.c state.h config.h
	$(CC) state.c -c -o state.o

text.o: text.c config.h term.h text.h draw.h state.h
	$(CC) text.c -c -o text.o

draw.o: draw.c config.h text.h state.h
	$(CC) draw.c -c -o draw.o
