#
# Makefile for sted v.0.2.1, Simple (or Stupid) Text Editor 
# by Linus kerlund.
#


#Compiler, change if you're using some other compiler
CC = gcc

#Compiler and linker options
# Tell your compiler that characters are not signed
debugCFLAGS = -Wall -O0 -g3 -funsigned-char
CFLAGS= -Wall -O2 -funsigned-char
LDFLAGS = -lncurses  

#Install directory
prefix = /usr/local

exec_prefix = $(prefix)
bindir  = $(exec_prefix)/bin
man1dir  = $(prefix)/man/man1
# install files with this ownership:
owner=root
group=staff
install_own = -o $(owner) -g $(group)
  

all:	sted

debug:
	$(MAKE) all CFLAGS="$(debugCFLAGS)"

static:
	$(MAKE) all LDFLAGS=-static

clean:
	rm -f *.o
	rm -f sted

#sted:	sted.o
#	$(CC) $(C_OPTS) -o sted sted.o $(L_OPTS)
#	strip sted

#sted.o:	sted.c 
#	$(CC) $(C_OPTS) -c sted.c

install: 
#	cp -f sted $(INSTDIR)/bin/sted
#	cp -f sted.1 $(INSTDIR)/man/man1/sted.1
	install -d $(install_own) -m 2775 $(bindir)
	install -s $(install_own) -m 775  sted      $(bindir)
	install -d $(install_own) -m 2775 $(man1dir)
	install    $(install_own) -m 664  sted.1     $(man1dir)

