############################################################################
### Makefile for make_trig_tab                                            ##
###                                                                       ##
### Version:     0.2                                                      ##
### Date:        07/25/2008                                               ##
### Author:      Michael Skutek (michael@skutek.de)                       ##
###                                                                       ##
### Description: makes a tabular for approximating trigonometric          ##
###              functions                                                ##
###                                                                       ##
### Platform:    UNIX, Windows (gcc)                                      ##
###                                                                       ##
### Include Files:                                                        ##
###              make_trib_tab.h:     some declarations                   ##
###                                                                       ##
### This program is free software: you can redistribute it and/or modify  ##
### it under the terms of the GNU Lesser General Public License as        ##
### published by the Free Software Foundation, either version 3 of the    ##
### License, or (at your option) any later version.                       ##
###                                                                       ##
### This program is distributed in the hope that it will be useful,       ##
### but WITHOUT ANY WARRANTY; without even the implied warranty of        ##
### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the          ##
### GNU Lesser General Public License for more details.                   ##
###                                                                       ##
### You should have received a copy of the GNU Lesser General Public      ##
### License along with this program. If not, see                          ##
### <http://www.gnu.org/licenses/>.                                       ##
############################################################################


INCLUDE_PATH = ./include/
INCLUDE_PATH_EXT = ./include_ext/
SRC_PATH = ./src/
SRC_PATH_EXT = ./src_ext/


CC = gcc
DEFINES = 



# for gcc on Linux
#be pedantic
WFLAGS_PEDANTIC = -Wconversion -Wwrite-strings -Wbad-function-cast -Wswitch-default

#warn "normal"
WFLAGS = -Wall -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wsign-compare\
         -Wshadow -Wcast-align -Wcast-qual -Wpointer-arith -Wuninitialized\
         -Wunused -Wunused-value -Wsequence-point -Wparentheses

#use WFLAGS or WFLAGS_PEDANTIC
CFLAGS = -g  $(WFLAGS) $(WFLAGS_PEDANTIC) $(DEFINES) -O2 -I/usr/X11/include -I$(INCLUDE_PATH) -I$(INCLUDE_PATH_EXT)
#CFLAGS = -g  $(WFLAGS) $(DEFINES) -O0-I/usr/X11/include -I$(INCLUDE_PATH) -I$(INCLUDE_PATH_EXT)
LDLIBS = -L/usr/X11R6/lib -lXpm -lX11 -lm #-lduma #-lefence             #include -lefence for memory read/write errors

#all main functions -> make_trig_tab
MAIN_OBJS = make_trig_tab.o
MAIN_HEADERS = $(INCLUDE_PATH)make_trig_tab.h


PROG =          ./bin/make_trig_tab
all:            $(PROG)


$(PROG):        $(MAIN_OBJS) $(MAIN_HEADERS)
		$(CC) $(CFLAGS) $(DEFINES) -o $(PROG) $(MAIN_OBJS) $(LDLIBS)

#---------------------------------------------------------

#main stuff

make_trig_tab.o:		$(MAIN_HEADERS) $(SRC_PATH)make_trig_tab.c $(INCLUDE_PATH)make_trig_tab.h
				$(CC) $(CFLAGS) $(DEFINES) -c -o make_trig_tab.o $(SRC_PATH)make_trig_tab.c


#----------------------------------------------------------

clean:			
			rm -f core $(MAIN_OBJS) $(PROG)

proper:				
			rm -f core $(MAIN_OBJS) $(PROG) *~ $(INCLUDE_PATH)*~ $(INCLUDE_PATH_EXT)*~ $(SRC_PATH)*~
