# Makefile for ANU p-Quotient Program Version 1.4 
# EO'B
# January 1997

#
# The following are valid compilation flags for the program.
#
# One of the following two flags should be set 
#
#GROUP -- compile p-group program 
#
#LIE -- compile Lie Ring program 
#
# One of the following three flags should be set 
#
#UNIX -- default development environment, should be set if compiling
#        in any UNIX environment (including AIX)
#
#SPARC -- if compiling on a SPARC station, set this flag in addition
#         to UNIX 
# 
#IBM  -- if compiling on a IBM machine running AIX, set this flag in
#        addition to UNIX
#
#STANDARD_PCP -- if compiling version which permits construction of
#                standard presentation
#
#LARGE_INT -- automorphism group order information is computed  
#             this *requires* the GNU MP routines and inclusion of libraries
#
# One of the following three flags should be set 
#
#CAYLEY_LINK -- CAYLEY is called by pq to perform insoluble stabiliser
#               calculations 
#
#Magma_LINK -- Magma is called by pq to perform insoluble stabiliser
#               calculations 
#
#GAP_LINK  -- GAP is called by pq to perform insoluble stabiliser calculations 
#
# If you have QUOTPIC installed on your machine, please set the
# following flag to ensure compatability
# 
#QUOTPIC -- if compiling version for incorporation in QUOTPIC
#
#Magma -- if compiling version for incorporation in Magma
#
#GAP -- if compiling version for incorporation in GAP
#
#DEBUG -- debugging information is generated by a number of procedures
#
# Change features of executable
#
#RUN_TIME -- supply maximum number of defining generators and class bound 
#             at run-time  (see README file for further details)
#
#TAILS_FILTER -- apply filter for exponent 4 and 5 and max occurrences
#
#CONSISTENCY_FILTER -- apply filter for exponent 4 and 5 and max occurrences
#
#
BASE   = ..
SRC    = ../src
LIE   = ../lie
CC     = gcc
#
#if you define LARGE_INT then GNULIB must point to gmp libraries 
#and GNUINC should point to gmp header files  
#
GNUINC = /usr/local/include 
GNULIB = /usr/local/lib 
#
#
#
EFILE  = $(BASE)/bin/pq.ext
#
INC    = $(BASE)/include
INC-LIE    = $(BASE)/lie-include
INCL   = -I$(BASE)/include -I$(BASE)/lie-include -I$(GNUINC)
CFLAGS = -g -DLARGE_INT -DSTANDARD_PCP -DUNIX -DGAP -DGAP_LINK_VIA_FILE -DGROUP $(INCL)

OBJS = \
AllocateSpace.o\
CAYLEY.o\
GAP.o\
GAP_link_via_file.o\
CAYLEY_present.o\
CloseFile.o\
Extend_Auts.o\
FreeSpace.o\
GAP_present.o\
Magma.o\
Magma_present.o\
OpenFile.o\
TemporaryFile.o\
action.o\
autgp_order.o\
assemble_matrix.o\
bit_print.o\
calculate_jacobi.o\
central_auts.o\
check_exponent.o\
class1_eliminate.o\
close_relations.o\
close_subgroup.o\
collect_comm.o\
collect_gen_word.o\
collect_relations.o\
collect_word.o\
collectp2.o\
commutator.o\
commute_dgen.o\
compact.o\
compact_description.o\
consistency_filter.o\
consistency_info.o\
construct.o\
defaults_pga.o\
degree.o\
delete_tables.o\
down_class.o\
echelon.o\
echelonise_matrix.o\
eliminate.o\
expand_commutator.o\
exponent_auts.o\
exponent_info.o\
extend_automorphisms.o\
extend_matrix.o\
extend_representation.o\
extra_relations.o\
find_allowable_subgroup.o\
find_image.o\
find_permutation.o\
formula.o\
generator_definition.o\
get_definition_sets.o\
identity.o\
immediate_descendant.o\
initialise_pcp.o\
initialise_pga.o\
insoluble_orbits.o\
int_power.o\
interactive_pga.o\
interactive_pq.o\
invert.o\
invert_auts.o\
invert_modp.o\
is_genlim_exceeded.o\
isom_options.o\
is_space_exhausted.o\
iteration.o\
label_to_subgroup.o\
last_class.o\
list_commutators.o\
main.o\
map_relations.o\
matrix.o\
maxoccur.o\
meataxe.o\
next_class.o\
options.o\
orbit_summary.o\
permute_elements.o\
permute_subgroups.o\
pgroup.o\
power.o\
pquotient.o\
pretty_filterfns.o\
print_arrays.o\
print_auts.o\
print_level.o\
print_structure.o\
quotpic.o\
read.o\
read_auts.o\
read_relations.o\
read_relator_file.o\
read_value.o\
read_word.o\
reduce_matrix.o\
reduced_covers.o\
report_error.o\
restore_group.o\
setup.o\
setup_reps.o\
soluble_orbits.o\
solve_equation.o\
stabiliser.o\
stages.o\
standard.o\
start_group.o\
start_iteration.o\
step_range.o\
store_definition_sets.o\
strip_identities.o\
subgroup_to_label.o\
system.o\
tail_info.o\
tails_filter.o\
update.o\
update_generators.o\
update_name.o\
vsystem.o\
consistency.o\
convert.o\
jacobi.o\
multiply_word.o\
pretty_filter.o\
print_presentation.o\
print_word.o\
read_parameters.o\
tails.o\
text.o\
write.o

LIEOBJS = \
$(LIE)/add.o\
$(LIE)/advanced_mult.o\
$(LIE)/calculate_words.o\
$(LIE)/evaluate.o\
$(LIE)/hall.o\
$(LIE)/lie_menus.o\
$(LIE)/lie_extra_relations.o\
$(LIE)/mult.o\
$(LIE)/permute.o\
$(LIE)/results.o\
$(LIE)/setup_filter.o\
$(LIE)/use_filter.o\
$(LIE)/lie_extend.o\
$(LIE)/lie_interactive_pq.o\
$(LIE)/lie_next_class.o\
$(LIE)/lie_options.o

LIEOBJS =

pq:	$(OBJS) $(LIEOBJS) collect.o
	echo "linking ..."
	$(CC) $(CFLAGS) -o $(EFILE) $(OBJS) $(LIEOBJS) collect.o -lm -lgmp -L$(GNULIB)

$(OBJS): $(INC)/pq_defs.h $(INC)/pga_vars.h  $(INC)/exp_vars.h\
	$(INC)/pcp_vars.h $(INC)/constants.h 

$(LIEOBJS)	: $(INC)/pq_defs.h $(INC)/pga_vars.h  $(INC)/exp_vars.h\
	$(INC)/pcp_vars.h $(INC)/constants.h $(INC-LIE)/lie_functions.h\
	$(INC-LIE)/lie_menus.h $(INC-LIE)/lie_template.h $(INC-LIE)/lie_testwd_info.h
	$(CC) $(CFLAGS) $(INCL) -o $*.o -c $*.c

collect.o: collect.c $(INC)/pq_defs.h $(INC)/pcp_vars.h $(INC)/constants.h
	$(CC) $(CFLAGS) $(INCL) -c $*.c

clean:
	@\rm $(OBJS) $(LIEOBJS) collect.o 
