diff --git a/.hgignore b/.hgignore index d84b781..218b7c9 100644 --- a/.hgignore +++ b/.hgignore @@ -1,3 +1,5 @@ syntax: glob Release\* -Debug\* \ No newline at end of file +Debug\* +*.o +sat diff --git a/Julian.cpp b/Julian.cpp index 9a1b0c5..5692a2b 100644 --- a/Julian.cpp +++ b/Julian.cpp @@ -25,14 +25,14 @@ Julian::Julian() { #else struct timeval tv; gettimeofday(&tv, NULL); - struct tm; - gmtime_r(&tv.tv_sec, &tm); - Initialize(tm.tm_year + 1900, - tm.tm_mon, - tm.tm_mday, - tm.tm_hour, - tm.tm_min, - (double) tm.tm_sec + (double) tv.tv_usec / 1000000.0) + struct tm gmt; + gmtime_r(&tv.tv_sec, &gmt); + Initialize(gmt.tm_year + 1900, + gmt.tm_mon, + gmt.tm_mday, + gmt.tm_hour, + gmt.tm_min, + (double) gmt.tm_sec + (double) tv.tv_usec / 1000000.0); #endif } diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..15208f4 --- /dev/null +++ b/Makefile @@ -0,0 +1,23 @@ +CC=g++ +CFLAGS=-c -Wall -g +LDFLAGS= +SOURCES=Coord.cpp \ + Globals.cpp \ + Julian.cpp \ + main.cpp \ + SGDP4.cpp \ + Tle.cpp \ + Vector.cpp +OBJECTS=$(SOURCES:.cpp=.o) +EXECUTABLE=sat + +all: $(SOURCES) $(EXECUTABLE) + +$(EXECUTABLE): $(OBJECTS) + $(CC) $(LDFLAGS) $(OBJECTS) -o $@ + +.cpp.o: + $(CC) $(CFLAGS) $< -o $@ + +clean: + rm -rf *.o $(EXECUTABLE)