################################################################################
# Makefile for mdate++                                                         
# $Id: Makefile,v 1.7 2002/03/29 14:50:41 ewe2 Exp $
#
# This makefile contains user serviceable parts!
#
# If the CFLAGS bother you, please dont change -ffloat-store which avoids
# architecture-related problems.
#
# If you want to add a needed target for your OS/distribution, go ahead but
# please email me (Sean Dwyer <ewe2@can.org.au>) and include a patch of your
# changes so everyone can share!
#
# There isn't an install target yet.
################################################################################

# Linux Target. Pretty much everything here.
# note that snprintf.c MUST be compiled by gcc, g++ will choke on it.
CXX=g++
INC=-I/usr/include -I.
DEFS=-DHAVE_CONFIG_H
CFLAGS=-O3 -Wall -fomit-frame-pointer -ffloat-store $(DEFS)
CXXFLAGS=$(CFLAGS)
LIBS=-lm


OBJS=mdate.o cmdline.o main.o snprintf.o getopt.o getopt1.o

mdate: $(OBJS) $(LIBS)
	$(CXX) $(CFLAGS) $(INC) -o mdate $(OBJS) $(LIBS)

snprintf.o:
	gcc $(CFLAGS) $(INC)  -c -o  snprintf.o snprintf.c

mdate.o: mdate.cc config.h mdate.hh version.h
cmdline.o: cmdline.cc config.h mdate.hh cmdline.h getopt.h version.h
main.o: main.cc config.h mdate.hh cmdline.h getopt.h version.h
getopt.o: getopt.c config.h getopt.h version.h
getopt1.o: getopt1.c config.h getopt.h version.h
snprintf.o: snprintf.c config.h version.h


.PHONY: clean

clean:
	-rm -f mdate $(OBJS)
