]> git.mxchange.org Git - flightgear.git/commitdiff
Restructuring make, adding automatic "make dep" support.
authorcurt <curt>
Thu, 26 Jun 1997 19:08:22 +0000 (19:08 +0000)
committercurt <curt>
Thu, 26 Jun 1997 19:08:22 +0000 (19:08 +0000)
12 files changed:
Aircraft/Makefile
Controls/Makefile
FDM/Makefile
LaRCsim/Makefile
Main/GLTKkey.c
Main/GLmain.c
Main/Makefile
Scenery/Makefile
Simulator/Makefile
Slew/Makefile
Time/Makefile
Time/fg_timer.c

index 2ba423b7ce17bae5628af46a8fe9400f769e151c..e554c8618a0e966e34b74e85681b40bf9b28c885 100644 (file)
@@ -31,8 +31,7 @@ HFILES = aircraft.h
 OFILES = $(CFILES:.c=.o)
 
 CC = gcc
-CFLAGS = -g -Wall
-# CFLAGS = -O2 -Wall
+CFLAGS = $(FG_CFLAGS)
 
 AR = ar
 
@@ -50,6 +49,9 @@ $(TARGET): $(OFILES) $(HFILES)
 
 all: $(TARGET)
 
+dep:                                 
+       $(CC) -MM *.c > depend                     
+
 clean:
        rm -f *.o $(TARGET) lib*.a *~ core
 
@@ -58,15 +60,17 @@ clean:
 # Secondary Targets
 #---------------------------------------------------------------------------
 
-aircraft.o: aircraft.c aircraft.h
-       $(CC) $(CFLAGS) $(INCLUDES) -c aircraft.c
+include depend
 
-aircraft.h: ../Flight/flight.h ../Controls/controls.h
-       touch aircraft.h
+aircraft.o:
+       $(CC) $(CFLAGS) $(INCLUDES) -c aircraft.c
 
 
 #---------------------------------------------------------------------------
 # $Log$
+# Revision 1.5  1997/06/26 19:08:28  curt
+# Restructuring make, adding automatic "make dep" support.
+#
 # Revision 1.4  1997/06/25 15:39:44  curt
 # Minor changes to compile with rsxnt/win32.
 #
index baa1e8bfb4e1fad7dc2e72eaa7aa9ed4aadea5ed..7315b7ade05d8c563793090294b0cb7876cc267d 100644 (file)
@@ -31,8 +31,7 @@ HFILES = controls.h
 OFILES = $(CFILES:.c=.o)
 
 CC = gcc
-CFLAGS = -g -Wall
-# CFLAGS = -O2 -Wall
+CFLAGS = $(FG_CFLAGS)
 
 AR = ar
 
@@ -50,6 +49,9 @@ $(TARGET): $(OFILES)
 
 all: $(TARGET)
 
+dep:                                 
+       $(CC) -MM *.c > depend                     
+
 clean:
        rm -f *.o $(TARGET) lib*.a *~ core
 
@@ -58,15 +60,17 @@ clean:
 # Secondary Targets
 #---------------------------------------------------------------------------
 
-controls.h: ../limits.h
-       touch controls.h
+include depend
 
-controls.o: controls.c controls.h ../Aircraft/aircraft.h
+controls.o:
        $(CC) $(CFLAGS) $(INCLUDES) -c controls.c
 
 
 #---------------------------------------------------------------------------
 # $Log$
+# Revision 1.6  1997/06/26 19:08:29  curt
+# Restructuring make, adding automatic "make dep" support.
+#
 # Revision 1.5  1997/06/25 15:39:46  curt
 # Minor changes to compile with rsxnt/win32.
 #
index 26a9ea058a5fa13bc5f1e05f59c19f9ab1833706..0082de4e83dc4899511440d5c1301c2cdfed5fb5 100644 (file)
@@ -30,8 +30,7 @@ CFILES = flight.c
 OFILES = $(CFILES:.c=.o)
 
 CC = gcc
-CFLAGS = -g -Wall
-# CFLAGS = -O2 -Wall
+CFLAGS = $(FG_CFLAGS)
 
 AR = ar
 
@@ -49,6 +48,9 @@ $(TARGET): $(OFILES)
 
 all: $(TARGET)
 
+dep:                                 
+       $(CC) -MM *.c > depend                     
+
 clean:
        rm -f *.o $(TARGET) lib*.a *~ core
 
@@ -57,15 +59,17 @@ clean:
 # Secondary Targets
 #---------------------------------------------------------------------------
 
-flight.h:  Slew/slew.h LaRCsim/ls_interface.h
-       touch flight.h
+include depend
 
-flight.o: flight.c flight.h
+flight.o:
        $(CC) $(CFLAGS) $(INCLUDES) -c flight.c
 
 
 #---------------------------------------------------------------------------
 # $Log$
+# Revision 1.6  1997/06/26 19:08:30  curt
+# Restructuring make, adding automatic "make dep" support.
+#
 # Revision 1.5  1997/06/25 15:39:46  curt
 # Minor changes to compile with rsxnt/win32.
 #
index 9b25a2c9c135f63d9295c8aa0cead177a9b2a148..d8c527375bc8a261b92931ec8f50dbf0e1e0de7d 100644 (file)
@@ -22,8 +22,7 @@ CFILES =  $(LaRCsimFILES) $(NavionFILES) $(InterfaceFILES)
 OFILES = $(CFILES:.c=.o)
 
 CC = gcc
-CFLAGS = -g
-# CFLAGS = -O2
+CFLAGS = $(FG_CFLAGS)
 
 AR = ar
 
@@ -44,6 +43,9 @@ simtest: $(TARGET) LaRCsim.o
 
 all: $(TARGET)
 
+dep:                                 
+       $(CC) -MM *.c > depend                     
+
 clean:
        rm -f *.o $(TARGET) *~ core
 
@@ -52,10 +54,14 @@ clean:
 # Secondary Targets
 #---------------------------------------------------------------------------
 
+include depend
 
 
 #---------------------------------------------------------------------------
 # $Log$
+# Revision 1.4  1997/06/26 19:08:30  curt
+# Restructuring make, adding automatic "make dep" support.
+#
 # Revision 1.3  1997/06/21 17:12:50  curt
 # Capitalized subdirectory names.
 #
index a6b6efc50885ca69f9814e802b99319be9886114..36595607feca05f59befa89b98ef70a30655a1ad 100644 (file)
@@ -30,7 +30,7 @@
 #include "gltk.h"
 
 #include "GLTKkey.h"
-#include "../aircraft/aircraft.h"
+#include "../Aircraft/aircraft.h"
 
 
 /* Handle keyboard events */
@@ -75,9 +75,12 @@ GLenum GLTKkey(int k, GLenum mask) {
 
 
 /* $Log$
-/* Revision 1.3  1997/06/21 17:12:52  curt
-/* Capitalized subdirectory names.
+/* Revision 1.4  1997/06/26 19:08:32  curt
+/* Restructuring make, adding automatic "make dep" support.
 /*
+ * Revision 1.3  1997/06/21 17:12:52  curt
+ * Capitalized subdirectory names.
+ *
  * Revision 1.2  1997/05/23 15:40:24  curt
  * Added GNU copyright headers.
  * Fog now works!
index 0b9483a0fa22a3ebf935f388e5bb9475c264e470..02cbcb70850d654f503c8908dd120d3e4676e8e7 100644 (file)
@@ -273,7 +273,11 @@ void fgUpdateTimeDepCalcs(int multi_loop) {
 
 void fgInitTimeDepCalcs() {
     /* initialize timer */
+
+#ifdef USE_ITIMER
     fgTimerInit( 1.0 / DEFAULT_TIMER_HZ, fgUpdateTimeDepCalcs );
+#endif USE_ITIMER
+
 }
 
 
@@ -416,6 +420,8 @@ int main( int argc, char *argv[] ) {
 
     f = &current_aircraft.flight;
 
+    printf("Flight Gear:  prototype code to test OpenGL, LaRCsim, and VRML\n\n");
+
     #ifdef GLUT
       /* initialize GLUT */
       glutInit(&argc, argv);
@@ -553,9 +559,12 @@ int main( int argc, char *argv[] ) {
 
 
 /* $Log$
-/* Revision 1.22  1997/06/25 15:39:47  curt
-/* Minor changes to compile with rsxnt/win32.
+/* Revision 1.23  1997/06/26 19:08:33  curt
+/* Restructuring make, adding automatic "make dep" support.
 /*
+ * Revision 1.22  1997/06/25 15:39:47  curt
+ * Minor changes to compile with rsxnt/win32.
+ *
  * Revision 1.21  1997/06/22 21:44:41  curt
  * Working on intergrating the VRML (subset) parser.
  *
index f60c695f5718c99895f5978748b0b1a1fcbddc0d..a682d7a655908e5fb4cdd86ab5b4f01fb823dd99 100644 (file)
@@ -28,12 +28,9 @@ TARGET=fgfs0
 
 CC = gcc
 
-# STD_FLAGS = -O2 -Wall
-STD_CFLAGS = -g -Wall
-
 
 #---------------------------------------------------------------------------
-# Define the high level GL interface library
+# This is overridden in the top level Makefile, if make is run from there.
 #---------------------------------------------------------------------------
 
 # For GLUT
@@ -53,15 +50,15 @@ INTERFACE_FILES = GLUTkey.c
 #---------------------------------------------------------------------------
 
 # For OpenGL
-GRAPHICS_LIBS = -lGLU -lGL -lXmu -lX11
+GRAPHICS_LIBS = -lGLU -lGL -lXmu -lX11
 
 # For Mesa
-MESA_LIBS = -L/usr/lib/mesa -lMesatk -lMesaaux -lMesaGLU -lMesaGL
-X11_LIBS =  -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11
-GRAPHICS_LIBS = $(MESA_LIBS) $(X11_LIBS)
+MESA_LIBS = -L/usr/lib/mesa -lMesatk -lMesaaux -lMesaGLU -lMesaGL
+X11_LIBS =  -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11
+GRAPHICS_LIBS = $(MESA_LIBS) $(X11_LIBS)
 
 
-CFLAGS = $(STD_CFLAGS) $(INTERFACE_FLAGS)
+CFLAGS = $(FG_CFLAGS) $(INTERFACE_FLAGS)
 LIBS =  $(INTERFACE_LIBS) $(GRAPHICS_LIBS) -lm -lfl
 
 CFILES = GLmain.c $(INTERFACE_FILES) mesh2GL.c
@@ -82,6 +79,9 @@ $(TARGET): $(OFILES) $(AFILES)
 
 all: $(TARGET)
 
+dep:
+       $(CC) -MM *.c > depend
+
 clean:
        rm -f *.o $(TARGET) lib*.a *~ core
 
@@ -90,22 +90,26 @@ clean:
 # Secondary Targets
 #---------------------------------------------------------------------------
 
-GLmain.o: GLmain.c GLUTkey.h ../Aircraft/aircraft.h ../Scenery/scenery.h \
-       ../Timer/fg_timer.h
-       $(CC) $(CFLAGS) $(INCLUDES) -c GLmain.c
+include depend
 
-GLUTkey.o: GLUTkey.c GLUTkey.h ../Aircraft/aircraft.h
-       $(CC) $(CFLAGS) $(INCLUDES) -c GLUTkey.c
+GLmain.o:
+       $(CC) $(CFLAGS) -c GLmain.c
 
-GLTKkey.o: GLTKkey.c GLTKkey.h ../Aircraft/aircraft.h
-       $(CC) $(CFLAGS) $(INCLUDES) -c GLTKkey.c
+GLUTkey.o:
+       $(CC) $(CFLAGS) -c GLUTkey.c
 
-mesh2GL.o: mesh2GL.c ../Scenery/mesh.h
-       $(CC) $(CFLAGS) $(INCLUDES) -c mesh2GL.c
+GLTKkey.o:
+       $(CC) $(CFLAGS) -c GLTKkey.c
+
+mesh2GL.o:
+       $(CC) $(CFLAGS) -c mesh2GL.c
 
 
 #---------------------------------------------------------------------------
 # $Log$
+# Revision 1.16  1997/06/26 19:08:33  curt
+# Restructuring make, adding automatic "make dep" support.
+#
 # Revision 1.15  1997/06/25 15:39:47  curt
 # Minor changes to compile with rsxnt/win32.
 #
index b0e0e3a87516c92ac1213de0b416249de563f059..93cc63f2e0efc8144abf2dbf6a5e8b9198a352ca 100644 (file)
@@ -31,8 +31,7 @@ HFILES =
 OFILES = $(CFILES:.c=.o)
 
 CC = gcc
-CFLAGS = -g -Wall
-# CFLAGS = -O2 -Wall
+CFLAGS = $(FG_CFLAGS)
 
 AR = ar
 
@@ -43,11 +42,14 @@ INCLUDES =
 # Primary Targets
 #---------------------------------------------------------------------------
 
-all: $(TARGET)
-
 $(TARGET): $(OFILES) $(HFILES)
        $(AR) rv $(TARGET) $(OFILES)
 
+all: $(TARGET)
+
+dep:                                 
+       $(CC) -MM *.c > depend                     
+
 clean:
        rm -f *.o $(TARGET) lib*.a *~ core
 
@@ -56,15 +58,20 @@ clean:
 # Secondary Targets
 #---------------------------------------------------------------------------
 
-common.o: common.c common.h
+include depend
+
+common.o:
        $(CC) $(CFLAGS) -c common.c
 
-mesh.o: mesh.c mesh.h common.h
+mesh.o:
        $(CC) $(CFLAGS) -c mesh.c
 
 
 #---------------------------------------------------------------------------
 # $Log$
+# Revision 1.10  1997/06/26 19:08:34  curt
+# Restructuring make, adding automatic "make dep" support.
+#
 # Revision 1.9  1997/06/25 15:39:48  curt
 # Minor changes to compile with rsxnt/win32.
 #
index 209a8c9601655b2b67a3bb54e7dc0825df08fff6..eaf1bc3d6b6cb2318e3a2d2f5052c9ca6de11802 100644 (file)
 #---------------------------------------------------------------------------
 
 
+#---------------------------------------------------------------------------
+# Choose your weapon
+#---------------------------------------------------------------------------
+
 CC = gcc
+export CC
 
 
+#---------------------------------------------------------------------------
+# Global Compile Options
+#
+# You may set FG_CFLAGS to include any of the following options depending on 
+# your environment:
+#
+# -g           - Compile with debugging symbols
+#
+# -Wall        - Enable full compiler warnings
+#
+# -O2          - Enable compiler optimization
+#
+# -DUSE_ITIMER - Use setitimer(), getitimer(), and signal() to mimic
+#                a real time system and call the flight model routines
+#                at a regular interval, rather than between screen updates
+#                which can be highly variable.  This can make the flight
+#                much smoother.
+#---------------------------------------------------------------------------
+
+FG_CFLAGS = -g -Wall -DUSE_ITIMER
+export FG_CFLAGS
+
+
+#---------------------------------------------------------------------------
+# Uncomment one of the following sections depending on your system
+#
+# You may set FG_GRAPHICS to include any of the following options depending
+# on your environment:
+#---------------------------------------------------------------------------
+
+#---------------------------------------------------------------------------
+# SGI IRIX with the GLUT toolkit
+#
+# INTERFACE_FLAGS = -DGLUT
+# INTERFACE_LIBS = -lglut
+# INTERFACE_FILES = GLUTkey.c
+# GRAPHICS_LIBS = -lGLU -lGL -lXmu -lX11
+#---------------------------------------------------------------------------
+
+#---------------------------------------------------------------------------
+# Linux/Mesa with the GLUT toolkit
+#
+INTERFACE_FLAGS = -DGLUT
+INTERFACE_LIBS = -lglut
+INTERFACE_FILES = GLUTkey.c
+MESA_LIBS = -L/usr/lib/mesa -lMesatk -lMesaaux -lMesaGLU -lMesaGL
+X11_LIBS =  -L/usr/X11R6/lib -lXext -lXmu -lXi -lX11
+GRAPHICS_LIBS = $(MESA_LIBS) $(X11_LIBS)
+#---------------------------------------------------------------------------
+
+#---------------------------------------------------------------------------
+# Windows 95/NT with the GLUT toolkit
+#
+# INTERFACE_FLAGS = -DGLUT
+# INTERFACE_LIBS = -lglut
+# INTERFACE_FILES = GLUTkey.c
+# GRAPHICS_LIBS = -lGLU -lGL
+#---------------------------------------------------------------------------
+
+export INTERFACE_FLAGS INTERFACE_LIBS GRAPHICS_LIBS
+
+
+#---------------------------------------------------------------------------
+# You shouldn't need to modify anything beyond this point
+#---------------------------------------------------------------------------
+
 SUBSUBDIRS = Flight/LaRCsim Flight/Slew Scenery/ParseScn Scenery/ParseVrml
 SUBDIRS = Aircraft Controls Flight mat3 Scenery Timer
 MAIN = OpenGL
 
 
-all:
-       for dir in $(SUBSUBDIRS) $(SUBDIRS) $(MAIN); do \
-           ( cd $$dir; make CC=$(CC) ) ; \
+all: 
+       for dir in $(SUBSUBDIRS) $(SUBDIRS); do \
+           ( cd $$dir; $(MAKE) ) ; \
        done
-
-
-install:
-       for dir in $(SUBSUBDIRS) $(SUBDIRS) $(MAIN); do \
-           ( cd $$dir; make CC=$(CC) install) ; \
+       for dir in $(MAIN); do \
+           ( cd $$dir; $(MAKE) ) ; \
        done
 
+dep:
+       for dir in $(SUBSUBDIRS) $(SUBDIRS); do \
+           ( cd $$dir; $(MAKE) dep ) ; \
+       done
+       for dir in $(MAIN); do \
+           ( cd $$dir; $(MAKE) dep ) ; \
+       done
 
 clean:
        -rm -f *~
        for dir in $(SUBSUBDIRS) $(SUBDIRS) $(MAIN); do \
-           (cd $$dir; make clean) ; \
+           (cd $$dir; $(MAKE) clean) ; \
        done
 
 
@@ -59,6 +134,9 @@ tar: clean
 
 #---------------------------------------------------------------------------
 # $Log$
+# Revision 1.10  1997/06/26 19:08:22  curt
+# Restructuring make, adding automatic "make dep" support.
+#
 # Revision 1.9  1997/06/22 21:44:40  curt
 # Working on intergrating the VRML (subset) parser.
 #
index 6faec02e6b63082babfd7389333fe75bd52eec4f..a14915c99586751fdbd93a7ec1bb34cd36163072 100644 (file)
@@ -30,8 +30,7 @@ CFILES = slew.c
 OFILES = $(CFILES:.c=.o)
 
 CC = gcc
-CFLAGS = -g -Wall
-# CFLAGS = -O2 -Wall
+CFLAGS = $(FG_CFLAGS)
 
 AR = ar
 
@@ -49,6 +48,9 @@ $(TARGET): $(OFILES)
 
 all: $(TARGET)
 
+dep:                                 
+       $(CC) -MM *.c > depend                     
+
 clean:
        rm -f *.o $(TARGET) lib*.a *~ core
 
@@ -57,12 +59,17 @@ clean:
 # Secondary Targets
 #---------------------------------------------------------------------------
 
-slew.o: slew.c slew.h ../../Aircraft/aircraft.h ../../Controls/controls.h
+include depend
+
+slew.o:
        $(CC) $(CFLAGS) $(INCLUDES) -c slew.c
 
 
 #---------------------------------------------------------------------------
 # $Log$
+# Revision 1.4  1997/06/26 19:08:31  curt
+# Restructuring make, adding automatic "make dep" support.
+#
 # Revision 1.3  1997/06/25 15:39:46  curt
 # Minor changes to compile with rsxnt/win32.
 #
index c835efe2c85f17ea7dad4c253a11582a79c98c13..b04827ea40803714a06660f6a3987c11f5162d22 100644 (file)
@@ -31,9 +31,7 @@ HFILES = fg_timer.h
 OFILES = $(CFILES:.c=.o)
 
 CC = gcc
-# CFLAGS = -g -Wall -DUSE_ITIMER
-CFLAGS = -g -Wall 
-# CFLAGS = -O2 -Wall
+CFLAGS = $(FG_CFLAGS)
 
 AR = ar
 
@@ -51,6 +49,9 @@ $(TARGET): $(OFILES)
 
 all: $(TARGET)
 
+dep:                                 
+       $(CC) -MM *.c > depend                     
+
 clean:
        rm -f *.o $(TARGET) lib*.a *~ core
 
@@ -59,12 +60,17 @@ clean:
 # Secondary Targets
 #---------------------------------------------------------------------------
 
-fg_timer.o: fg_timer.c fg_timer.h
+include depend
+
+fg_timer.o:
        $(CC) $(CFLAGS) $(INCLUDES) -c fg_timer.c
 
 
 #---------------------------------------------------------------------------
 # $Log$
+# Revision 1.4  1997/06/26 19:08:37  curt
+# Restructuring make, adding automatic "make dep" support.
+#
 # Revision 1.3  1997/06/25 17:46:58  curt
 # Make itimer support optional.
 #
index 71a196019b95186a0b5ec584fd36c9a78470a2d2..0b07037eff123a88491b9d986590677595c23579 100644 (file)
@@ -35,7 +35,7 @@
 
 unsigned long int fgSimTime;
 
-#ifdef HAVE_ITIMER
+#ifdef USE_ITIMER
   static struct itimerval t, ot;
   static void (*callbackfunc)(int multi_loop);
 
@@ -109,9 +109,12 @@ int fgGetTimeInterval() {
 
 
 /* $Log$
-/* Revision 1.4  1997/06/25 15:39:49  curt
-/* Minor changes to compile with rsxnt/win32.
+/* Revision 1.5  1997/06/26 19:08:38  curt
+/* Restructuring make, adding automatic "make dep" support.
 /*
+ * Revision 1.4  1997/06/25 15:39:49  curt
+ * Minor changes to compile with rsxnt/win32.
+ *
  * Revision 1.3  1997/06/17 16:52:04  curt
  * Timer interval stuff now uses gettimeofday() instead of ftime()
  *