# IMPORTANT *****************************************************  IMPORTANT

# Not all the source files are included. The following routines are missing:
# comp_hack.c, lud_hack.c, lub_hack.c cis_hack.c mpr_hack.c
# These are modified copies of source files printed in the book
# 'Numerical Recipes in C', by Press et al, 2nd edition, Cambridge Uni. Press
# (1992). You *must* get these source files and modify according to details
# in the file README. Typing 'make' will *not* give you an executable!
 
# IMPORTANT *****************************************************  IMPORTANT

LIBS = -lm   
CC= gcc     # I've made  CC a link to g++, so CC works at home and at work.
CFLAGS=   -DANSI -DUNIX -DGCC -g
all: optimise input yagi output first rantest

YAGI-OBJECTS = yagi.o num_elem.o getfiles.o nrutil.o string.o read_dat.o self.o mutual.o z.o cis_hack.o com_hack.o v.o lud_hack.o lub_hack.o header.o write_co.o print_z.o version.o getopt.o usage2.o mpr_hack.o


yagi: $(YAGI-OBJECTS) makefile  nr_hack.h com_hack.h
	$(CC) $(CFLAGS) $(YAGI-OBJECTS) $(LIBS) -o yagi

INPUT-OBJECTS = input.o nrutil.o string.o write_ip.o num_elem.o version.o usage2.o getopt.o 

input: $(INPUT-OBJECTS) makefile    com_hack.h nr_hack.h 
	$(CC) $(CFLAGS) $(INPUT-OBJECTS) $(LIBS) -o  input



OUTPUT-OBJECTS = output.o nrutil.o read_hea.o string.o z_input.o vswr.o refco.o com_hack.o pin.o gain.o write_ga.o version.o usage2.o getopt.o  zbr_hack.o

output: $(OUTPUT-OBJECTS) makefile  
	$(CC) $(CFLAGS) $(OUTPUT-OBJECTS) $(LIBS) -o  output

FIRST-OBJECTS = first.o nrutil.o write_ip.o string.o getopt.o usage2.o version.o showfirs.o
first: $(FIRST-OBJECTS) makefile   
	$(CC) $(CFLAGS) $(FIRST-OBJECTS) $(LIBS) -o  first

OPTIMISE-OBJECTS = optimise.o string.o read_dat.o  nrutil.o num_elem.o  version.o z.o lud_hack.o lub_hack.o gain.o self.o mutual.o pin.o com_hack.o cis_hack.o v.o z_input.o randomis.o better.o write_ip.o refco.o vswr.o usage.o copym.o perform.o getopt.o showopt.o solve.o print_z.o  ck_flags.o errormsg.o max_gain.o dobetter.o gaussian.o sens.o fitness.o mpr_hack.o genetic.o ga_lib.o random.o

optimise: $(OPTIMISE-OBJECTS) makefile  
	$(CC) $(CFLAGS) $(OPTIMISE-OBJECTS) $(LIBS) -o  optimise

RAND-OBJECTS=random.o rantest.o

rantest: $(RAND-OBJECTS) makefile
	$(CC) $(CFLAGS) $(RAND-OBJECTS) $(LIBS) -o  rantest


clean:
	rm -f optimise 
	rm -f input 
	rm -f output 
	rm -f yagi 
	rm -f first 
	rm -f rantest
	rm -f *.o
	rm -f *%
	rm -f core
