mirror of
https://github.com/nasa/trick.git
synced 2025-04-08 11:54:23 +00:00
Added C support
This commit is contained in:
parent
04c0fea046
commit
74c75123aa
@ -134,9 +134,16 @@ if ($full_build)
|
||||
foreach $src (@src_files)
|
||||
{
|
||||
$file = $src ;
|
||||
$file =~ s/\Q.cpp\E$// ;
|
||||
$file =~ s/\Q.c$\E$// ;
|
||||
$cmd = "g++ $source_make_args -I $trick_home" . "/include -c $src -o $file.o" ;
|
||||
if($file =~ /\S*(\Q.c\E)$/)
|
||||
{
|
||||
$file =~ s/\Q.c\E$// ;
|
||||
$cmd = "gcc $source_make_args -I $trick_home" . "/include -c $src -o $file.o" ;
|
||||
}
|
||||
else
|
||||
{
|
||||
$file =~ s/\Q.cpp\E$// ;
|
||||
$cmd = "g++ $source_make_args -I $trick_home" . "/include -c $src -o $file.o" ;
|
||||
}
|
||||
if($debug)
|
||||
{
|
||||
print "Building obj file: $cmd\n" ;
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "sim_objects/default_trick_sys.sm"
|
||||
##include "Foo.hh"
|
||||
##include "Bar.hh"
|
||||
##include "Bar.h"
|
||||
##include "Baz.hh"
|
||||
|
||||
class Sandbox : public Trick::SimObject {
|
||||
@ -8,7 +8,6 @@ class Sandbox : public Trick::SimObject {
|
||||
public:
|
||||
|
||||
Foo foo;
|
||||
Bar bar;
|
||||
Baz baz;
|
||||
|
||||
Sandbox() {
|
||||
|
@ -0,0 +1,6 @@
|
||||
#include "Bar.h"
|
||||
|
||||
int process(long long x) {return 0;}
|
||||
void add() {}
|
||||
void remove_Bar() {}
|
||||
void restart() {}
|
@ -1,7 +0,0 @@
|
||||
#include "Bar.hh"
|
||||
|
||||
|
||||
void Bar::add() {}
|
||||
void Bar::remove() {}
|
||||
void Bar::restart() {}
|
||||
|
@ -0,0 +1,16 @@
|
||||
// @trick_parse{everything}
|
||||
|
||||
#include "trick/exec_proto.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
void add();
|
||||
void remove_Bar();
|
||||
void restart();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
@ -1,17 +0,0 @@
|
||||
// @trick_parse{everything}
|
||||
|
||||
#include "trick/Event.hh"
|
||||
|
||||
/**
|
||||
* Induce an `%import sim_services` statement in this class's Python module by inheriting from a
|
||||
* Trick class. This allows us to test if `sys.path` contains the correct path to `sim_services.py`
|
||||
* (and other modules generated during a sim build) for Trickified projects.
|
||||
*/
|
||||
class Bar : public Trick::Event {
|
||||
|
||||
int process(long long) {return 0;}
|
||||
void add();
|
||||
void remove();
|
||||
void restart();
|
||||
|
||||
};
|
@ -1,6 +1,6 @@
|
||||
#include "sim_objects/default_trick_sys.sm"
|
||||
##include "Foo.hh"
|
||||
##include "Bar.hh"
|
||||
##include "Bar.h"
|
||||
##include "Baz.hh"
|
||||
|
||||
class Sandbox : public Trick::SimObject {
|
||||
@ -8,7 +8,6 @@ class Sandbox : public Trick::SimObject {
|
||||
public:
|
||||
|
||||
Foo foo;
|
||||
Bar bar;
|
||||
Baz baz;
|
||||
|
||||
Sandbox() {
|
||||
|
@ -0,0 +1,6 @@
|
||||
#include "Bar.h"
|
||||
|
||||
int process(long long x) {return 0;}
|
||||
void add() {}
|
||||
void remove_Bar() {}
|
||||
void restart() {}
|
@ -1,7 +0,0 @@
|
||||
#include "Bar.hh"
|
||||
|
||||
|
||||
void Bar::add() {}
|
||||
void Bar::remove() {}
|
||||
void Bar::restart() {}
|
||||
|
@ -0,0 +1,16 @@
|
||||
// @trick_parse{everything}
|
||||
|
||||
#include "trick/exec_proto.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
void add();
|
||||
void remove_Bar();
|
||||
void restart();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
@ -1,17 +0,0 @@
|
||||
// @trick_parse{everything}
|
||||
|
||||
#include "trick/Event.hh"
|
||||
|
||||
/**
|
||||
* Induce an `%import sim_services` statement in this class's Python module by inheriting from a
|
||||
* Trick class. This allows us to test if `sys.path` contains the correct path to `sim_services.py`
|
||||
* (and other modules generated during a sim build) for Trickified projects.
|
||||
*/
|
||||
class Bar : public Trick::Event {
|
||||
|
||||
int process(long long) {return 0;}
|
||||
void add();
|
||||
void remove();
|
||||
void restart();
|
||||
|
||||
};
|
@ -1,6 +1,6 @@
|
||||
#include "sim_objects/default_trick_sys.sm"
|
||||
##include "Foo.hh"
|
||||
##include "Bar.hh"
|
||||
##include "Bar.h"
|
||||
##include "Baz.hh"
|
||||
|
||||
class Sandbox : public Trick::SimObject {
|
||||
@ -8,7 +8,6 @@ class Sandbox : public Trick::SimObject {
|
||||
public:
|
||||
|
||||
Foo foo;
|
||||
Bar bar;
|
||||
Baz baz;
|
||||
|
||||
Sandbox() {
|
||||
|
@ -0,0 +1,6 @@
|
||||
#include "Bar.h"
|
||||
|
||||
int process(long long x) {return 0;}
|
||||
void add() {}
|
||||
void remove_Bar() {}
|
||||
void restart() {}
|
@ -1,7 +0,0 @@
|
||||
#include "Bar.hh"
|
||||
|
||||
|
||||
void Bar::add() {}
|
||||
void Bar::remove() {}
|
||||
void Bar::restart() {}
|
||||
|
@ -0,0 +1,16 @@
|
||||
// @trick_parse{everything}
|
||||
|
||||
#include "trick/exec_proto.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
void add();
|
||||
void remove_Bar();
|
||||
void restart();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
@ -1,17 +0,0 @@
|
||||
// @trick_parse{everything}
|
||||
|
||||
#include "trick/Event.hh"
|
||||
|
||||
/**
|
||||
* Induce an `%import sim_services` statement in this class's Python module by inheriting from a
|
||||
* Trick class. This allows us to test if `sys.path` contains the correct path to `sim_services.py`
|
||||
* (and other modules generated during a sim build) for Trickified projects.
|
||||
*/
|
||||
class Bar : public Trick::Event {
|
||||
|
||||
int process(long long) {return 0;}
|
||||
void add();
|
||||
void remove();
|
||||
void restart();
|
||||
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user