From be119a18a82480441b4cadb3754813cbc6d00293 Mon Sep 17 00:00:00 2001 From: curt Date: Fri, 24 Apr 1998 00:45:53 +0000 Subject: [PATCH] C++-ifing the code a bit. --- Cockpit/Makefile.am | 4 ++-- Cockpit/Makefile.in | 32 ++++++++++++++++++++++-------- Cockpit/{cockpit.c => cockpit.cxx} | 15 +++++++++----- Cockpit/{cockpit.h => cockpit.hxx} | 26 +++++++++++------------- Cockpit/{hud.c => hud.cxx} | 17 ++++++++++------ Cockpit/{hud.h => hud.hxx} | 25 +++++++++++++++-------- 6 files changed, 76 insertions(+), 43 deletions(-) rename Cockpit/{cockpit.c => cockpit.cxx} (94%) rename Cockpit/{cockpit.h => cockpit.hxx} (84%) rename Cockpit/{hud.c => hud.cxx} (99%) rename Cockpit/{hud.h => hud.hxx} (95%) diff --git a/Cockpit/Makefile.am b/Cockpit/Makefile.am index 38c8803d0..2b3be56a3 100644 --- a/Cockpit/Makefile.am +++ b/Cockpit/Makefile.am @@ -2,7 +2,7 @@ libdir = ${exec_prefix}/lib lib_LTLIBRARIES = libCockpit.la libCockpit_la_SOURCES = \ - cockpit.c cockpit.h \ - hud.c hud.h + cockpit.cxx cockpit.hxx \ + hud.cxx hud.hxx INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib -I$(top_builddir)/Simulator diff --git a/Cockpit/Makefile.in b/Cockpit/Makefile.in index 062a2a64d..c8a9a77b1 100644 --- a/Cockpit/Makefile.in +++ b/Cockpit/Makefile.in @@ -74,8 +74,8 @@ libdir = ${exec_prefix}/lib lib_LTLIBRARIES = libCockpit.la libCockpit_la_SOURCES = \ - cockpit.c cockpit.h \ - hud.c hud.h + cockpit.cxx cockpit.hxx \ + hud.cxx hud.hxx mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../../Include/config.h CONFIG_CLEAN_FILES = @@ -93,10 +93,10 @@ X_PRE_LIBS = @X_PRE_LIBS@ libCockpit_la_LDFLAGS = libCockpit_la_LIBADD = libCockpit_la_OBJECTS = cockpit.lo hud.lo -CFLAGS = @CFLAGS@ -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) -LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ +CXXFLAGS = @CXXFLAGS@ +CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CXXFLAGS) +CXXLINK = $(LIBTOOL) --mode=link $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ DIST_COMMON = Makefile.am Makefile.in @@ -105,13 +105,14 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = tar GZIP = --best DEP_FILES = .deps/cockpit.P .deps/hud.P +CXXMKDEP = $(CXX) -M $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CXXFLAGS) SOURCES = $(libCockpit_la_SOURCES) OBJECTS = $(libCockpit_la_OBJECTS) all: Makefile $(LTLIBRARIES) .SUFFIXES: -.SUFFIXES: .S .c .lo .o .s +.SUFFIXES: .S .c .cxx .lo .o .s $(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu Simulator/Cockpit/Makefile @@ -178,7 +179,11 @@ distclean-libtool: maintainer-clean-libtool: libCockpit.la: $(libCockpit_la_OBJECTS) $(libCockpit_la_DEPENDENCIES) - $(LINK) -rpath $(libdir) $(libCockpit_la_LDFLAGS) $(libCockpit_la_OBJECTS) $(libCockpit_la_LIBADD) $(LIBS) + $(CXXLINK) -rpath $(libdir) $(libCockpit_la_LDFLAGS) $(libCockpit_la_OBJECTS) $(libCockpit_la_LIBADD) $(LIBS) +.cxx.o: + $(CXXCOMPILE) -c $< +.cxx.lo: + $(LTCXXCOMPILE) -c $< tags: TAGS @@ -245,6 +250,17 @@ maintainer-clean-depend: @-sed -e 's/^\([^:]*\)\.o:/\1.lo \1.o:/' \ < .deps/$(*F).p > .deps/$(*F).P @-rm -f .deps/$(*F).p + +%.o: %.cxx + @echo '$(CXXCOMPILE) -c $<'; \ + $(CXXCOMPILE) -Wp,-MD,.deps/$(*F).P -c $< + +%.lo: %.cxx + @echo '$(LTCXXCOMPILE) -c $<'; \ + $(LTCXXCOMPILE) -Wp,-MD,.deps/$(*F).p -c $< + @-sed -e 's/^\([^:]*\)\.o:/\1.lo \1.o:/' \ + < .deps/$(*F).p > .deps/$(*F).P + @-rm -f .deps/$(*F).p info: dvi: check: all diff --git a/Cockpit/cockpit.c b/Cockpit/cockpit.cxx similarity index 94% rename from Cockpit/cockpit.c rename to Cockpit/cockpit.cxx index 68a7df11c..2cdbfbcc6 100644 --- a/Cockpit/cockpit.c +++ b/Cockpit/cockpit.cxx @@ -24,7 +24,9 @@ **************************************************************************/ -#include +#ifdef HAVE_CONFIG_H +# include +#endif #ifdef HAVE_WINDOWS_H # include @@ -33,7 +35,6 @@ #include #include -#include #include @@ -43,9 +44,10 @@ #include #include #include -#include