#
# Makefile for HexEdit v0.21
# (c) 1999 Petr Baudis <pasky@libra.sinus.cz>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License - please see
# any source file of HexEdit to get more informations about it.
#
# My first makefile :) - It's nice, isn't it?
#

# Used compiler
CC=gcc

# Main CFLAGS
CFLAGS=$(COFLAGS) $(CIFLAGS) -Wall

# Optimalization flags - if you want to use debugging, please use target debug
COFLAGS=-O6 -s -fomit-frame-pointer -m486 -malign-loops=0 -malign-functions=2 -malign-jumps=0

# Include flags
CIFLAGS=-I../include

# Flags for ld
LDFLAGS=

# Libraries to link with
LDLIBS=-lncurses

# Directory where to install hexedit - if you want, you can modify it to /usr/local...
PREFIX=/usr
BINDIR=$(PREFIX)/bin
MANDIR=$(PREFIX)/man/man1

############################################
# and targets (you shouldn't modify anything bellow in standart configuration) :

all:
	(cd src; $(MAKE) "CC=$(CC)" "CFLAGS=$(CFLAGS)"\
	 "LDFLAGS=$(LDFLAGS)" "LDLIBS=$(LDLIBS)" $@)

debug:
	(cd src; $(MAKE) "CC=$(CC)" "CFLAGS=$(CIFLAGS) -Wall -g -pg"\
	 "LDFLAGS=$(LDFLAGS)" "LDLIBS=$(LDLIBS)" $@)

install:
	cp ./bin/hexedit $(BINDIR)
	cp ./man/hexedit.1 $(MANDIR)

lazyclean:
	- rm -f *~ core bin/*~ bin/core

clean: lazyclean
	- rm -f src/*.o

distclean: clean
	(cd src; $(MAKE) $@)


# gcc -o $1 $1.c -Wall $GCC_OPTIONS $2 $3 $4 $5 $6 $7 $8 $9

