head	1.3;
access;
symbols;
locks; strict;
comment	@# @;


1.3
date	93.05.18.16.53.03;	author craig;	state Exp;
branches;
next	1.2;

1.2
date	93.04.28.18.32.34;	author craig;	state Exp;
branches;
next	1.1;

1.1
date	93.04.05.19.41.17;	author craig;	state Exp;
branches;
next	;


desc
@working makefile
@


1.3
log
@first full-blown version to generate sawsat, plotgen, etc.
@
text
@############################################
# Makefile for satellite tracking software #
############################################

##############################
# define variables and paths #
##############################

#	tell make what default target is

SAT : includes astroalmn isat bsat sunsat sawsat plotgen

#	other targets

ISAT : includes astroalmn isat
BSAT : includes astroalmn bsat
SUNSAT : includes astroalmn sunsat
SAWSAT : includes astroalmn sawsat
PLOTGEN : includes astroalmn plotgen

CC = gcc
LD = gcc

# where the executables go

BIN = /home/mhd/craig/bin

# where the gcc stuff is located

GCCHEAD = /usr/local/export/gnu

# where the almanac stuff is located

APATH = ./almanac

# where the include files are located

HPATH = ./h

# where the libraries are located

LPATH = ./lib

# the aalib

AALIB = $(LPATH)/aalib.a
SATLIB = $(LPATH)/satlib.a
MATH = -lm
LIBS = $(SATLIB) $(AALIB) $(MATH)

CFLAGS = -O -I/usr/5include  -I$(HPATH)

CFILES	= sgp4.c deep.c thetag.c fmod2p.c sdp4.c sdp8.c sgp.c sgp8.c \
        mjd.c rsat.c search.c satellite.h satproto.h aaproto.h

OFILES	= sgp4.o deep.o thetag.o fmod2p.o sdp4.o sdp8.o sgp.o sgp8.o \
        mjd.o rsat.o search.o 


# Set the include file directory search path

vpath %.h $(HPATH)

################
# Dependencies #
################

sgp4.o deep.o thetag.o fmod2p.o sdp4.o sdp8.o sgp.o sgp8.o : satellite.h
rsat.o search.o : satellite.h
driver.o  bdriver.o sunsat.o sawsat.o plotgen.o : satellite.h

$(OFILES) : satproto.h
driver.o bdriver.o sunsat.o sawsat.o plotgen.o : satproto.h

sgp.o sgp4.o sgp8.o sdp4.o sdp8.o deep.o rsat.o : aaproto.h
driver.o bdriver.o sunsat.o sawsat.o plotgen.o : aaproto.h

sawsat.o : kep.h

#########
# Rules #
#########

#	rule to build the interactive satellite driver executable

isat : driver.o $(AALIB) $(CFILES)
	make getfiles
	@@echo " " 
	$(LD) -o isat driver.o $(LIBS)
	mv isat $(BIN)
	@@touch isat
	@@rlog -t RCS/*,v > Filelist
	@@echo " "
	@@rm -f $(OFILES)

#	rule to build the batch satellite driver executable

bsat : bdriver.o $(AALIB) $(CFILES)
	make getfiles
	@@echo " " 
	$(LD) -o bsat bdriver.o $(LIBS)
	mv bsat $(BIN)
	@@touch bsat
	@@rlog -t RCS/*,v > Filelist
	@@echo " "
	@@rm -f $(OFILES)

#	rule to build the near sun satellite driver executable

sunsat : sunsat.o $(AALIB) $(CFILES)
	make getfiles
	@@echo " " 
	$(LD) -o sunsat sunsat.o $(LIBS)
	mv sunsat $(BIN)
	@@touch sunsat
	@@rlog -t RCS/*,v > Filelist
	@@echo " "
	@@rm -f $(OFILES)

#	rule to build the near position search driver executable

sawsat : sawsat.o $(AALIB) $(CFILES)
	make getfiles
	@@echo " " 
	$(LD) -o sawsat sawsat.o $(LIBS)
	mv sawsat $(BIN)
	@@touch sawsat
	@@rlog -t RCS/*,v > Filelist
	@@echo " "
	@@rm -f $(OFILES)

#	rule to build the gnuplot plot file generator 

plotgen : plotgen.o  $(AALIB)
	@@echo " " 
	$(LD) -o plotgen plotgen.o $(LIBS)
	mv plotgen $(BIN)
	@@touch plotgen
	@@echo " "

#	rule to build the satlib.a library archive

satlib.a : $(OFILES)
	@@echo " "
	ar rc $(SATLIB) $(OFILES)
	ranlib $(SATLIB)
	@@echo " "
	@@touch satlib

#	get the object files from the library archive

getfiles : $(CFILES) 
	@@echo " "
	-csh -c "if (!(-e rsat.o) && -e $(SATLIB)) ar xo $(SATLIB) $(OFILES)"
	@@echo " "
	make satlib.a
	@@touch getfiles

#	rule to make sure the include files are current

includes :
	@@echo " "
	cd $(HPATH); $(MAKE)
	@@echo " "

#	rule to make sure the almanac library is current

astroalmn :
	@@echo " "
	cd $(APATH); $(MAKE)
	@@echo " "

#	default rule to make .o files from .c files

%.o : %.c
	@@echo " "
####	generate code
	$(CC) $(CFLAGS) -ansi -pedantic -c -Wall $*.c

#	misc rules

clean :
	rm -f $(OFILES) junk crud core *.BAK
@


1.2
log
@Put the common subroutines into a satlib.a library.
@
text
@d1 3
a3 3
###################################################
# Makefile for seesat satellite tracking software #
###################################################
d11 1
a11 1
ESAT : includes astroalmn esat
d13 8
d24 4
d54 1
a54 1
        mjd.c rsat.c
d57 1
a57 1
        mjd.o rsat.o
d69 2
a70 1
driver.o  rsat.o : satellite.h
d72 2
d75 2
a76 1
driver.o $(OFILES) : satproto.h
d78 1
a78 1
sgp.o sgp4.o sgp8.o sdp4.o sdp8.o deep.o driver.o rsat.o : aaproto.h
d84 37
a120 1
#	rule to build the satellite driver executable
d122 1
a122 1
esat : driver.o $(AALIB) $(CFILES)
d125 3
a127 1
	$(LD) -o esat driver.o $(LIBS)
d130 10
a139 1
	rm $(OFILES)
d148 1
d152 1
a152 1
getfiles: 
d154 1
a154 1
	csh -c "if (-e $(SATLIB)) ar xo $(SATLIB) $(OFILES)"
d157 1
d183 1
a183 1
	-rm -f *.o lint.log core *.BAK
@


1.1
log
@Initial revision
@
text
@d11 1
a11 1
ESAT : esat
d16 2
d20 13
a32 1
CFLAGS = -O -I/usr/5include 
d34 4
a37 2
FILES	= sgp4.o deep.o thetag.o fmod2p.o sdp4.o sdp8.o sgp.o sgp8.o \
        driver.o mjd.o
d39 1
a39 1
#	 Set include file directory search path
d41 2
a42 1
# vpath %.h $(H0):$(H1)
d44 8
d57 1
a57 1
driver.o : satellite.h
a58 2
sgp4.o deep.o thetag.o fmod2p.o sdp4.o sdp8.o sgp.o sgp8.o : satproto.h
driver.o : satproto.h
d60 1
a60 1
driver.o mjd.o : astro.h
d62 2
d68 1
a68 1
#	rule to build the videk.o library
d70 4
a73 2
esat : $(FILES)
	$(LD) -o esat -lm $(FILES) -lm
d75 4
a78 1
	@@touch esat
d80 14
d96 11
a106 3
# includes :
#	@@echo " "
#	cd $(H0); $(MAKE)
a113 1
####	generate relocation bits (-r) but don't preserve local symbols (-x)
@
