Changeset 1019 for trunk


Ignore:
Timestamp:
Jun 8, 2008 6:32:32 PM (16 years ago)
Author:
gah
Message:

added missing Makefiles

Location:
trunk/examples
Files:
28 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/c-example/Makefile.in

    r833 r1019  
    1 # define rappture src directory
    2 ifndef RP_BASE
    3 RP_BASE         = @prefix@
    4 endif
    51
    6 PROGS           = plot plotc compress compressc
     2bindir          = @bindir@
     3datadir         = @datadir@
     4datarootdir     = @datarootdir@
     5exec_prefix     = @exec_prefix@
     6includedir      = @includedir@
     7libdir          = @libdir@
     8mandir          = @mandir@
     9prefix          = @prefix@
     10srcdir          = @srcdir@
    711
    8 # define our compiling environment
    9 #
     12INSTALL         = @INSTALL@
     13INSTALL_DATA    = @INSTALL_DATA@
     14
    1015CC              = @CC@
     16CFLAGS          = @CFLAGS@
    1117CXX             = @CXX@
    12 DEBUG           = -g -Wall
    13 DEBUG_PLUS      = -g -DDEBUG
     18CXXFLAGS        = @CFLAGS@
     19DEFINES         = -g -Wall
     20INCLUDES        = -I$(srcdir)/../../src/core \
     21                  -I$(includedir)
     22LIBS            = \
     23                -L../../src/core -lrappture \
     24                -L$(libdir) -lexpat -lb64 -lz
     25VPATH           = $(srcdir)
    1426
    15 # define our directories
    16 #
    17 INCLUDES_DIR    = $(RP_BASE)/include
    18 INCL_CEE        = -I $(INCLUDES_DIR)/cee
    19 INCL_CORE       = -I $(INCLUDES_DIR)/core
    20 INCL_RP_DEPS    = -I $(RP_BASE)/include
     27CXX_SWITCHES    = $(CXXFLAGS) $(INCLUDES) $(DEFINES)   
     28CC_SWITCHES     = $(CFLAGS) $(INCLUDES) $(DEFINES)     
    2129
    22 INCL_FILES      = $(INCL_CEE) $(INCL_CORE) $(INCL_RP_DEPS)
     30FILES           = \
     31                $(srcdir)/README \
     32                $(srcdir)/compress.c \
     33                $(srcdir)/compress.cc \
     34                $(srcdir)/output.dx \
     35                $(srcdir)/plot.cc \
     36                $(srcdir)/plotc.c \
     37                $(srcdir)/tool.xml \
     38                $(srcdir)/tool2.xml \
     39                Makefile
    2340
    24 LIB_DIR         = $(RP_BASE)/lib
    25 LIB_RAPPTURE    = -Wl,-rpath,$(LIB_DIR) -L$(LIB_DIR) -lrappture
    26 LIB_RAPPTURE_MAC = -L$(LIB_DIR) -lrappture -lscew
     41destdir         = $(prefix)/examples/c-example
     42
     43
     44PROGS           = \
     45                compress \
     46                compressc \
     47                plot \
     48                plotc \
    2749
    2850all: $(PROGS)
    2951
    30 compress: compress.cc
    31         @if test "`uname`" == "Darwin"; then \
    32                 $(CXX) $(DEBUG) $(INCL_FILES) -o $@ $< $(LIB_RAPPTURE_MAC); \
    33         else \
    34                 $(CXX) $(DEBUG) $(INCL_FILES) -o $@ $< $(LIB_RAPPTURE); \
    35         fi
     52compress: $(srcdir)/compress.cc
     53        $(CXX) $(CXX_SWITCHES) -o $@ $< $(LIBS)
     54compressc: $(srcdir)/compress.c
     55        $(CC) $(CC_SWITCHES) -o $@ $< $(LIBS)
     56plot: $(srcdir)/plot.cc
     57        $(CXX) $(CXX_SWITCHES) -o $@ $< $(LIBS)
     58plotc: $(srcdir)/plotc.c
     59        $(CC) $(CC_SWITCHES) -o $@ $< $(LIBS)
    3660
    37 compressc: compress.c
    38         @if test "`uname`" == "Darwin"; then \
    39                 $(CC) $(DEBUG) $(INCL_FILES) -o $@ $< $(LIB_RAPPTURE_MAC); \
    40         else \
    41                 $(CC) $(DEBUG) $(INCL_FILES) -o $@ $< $(LIB_RAPPTURE); \
    42         fi
     61install:
     62        $(INSTALL) -d $(destdir)
     63        for i in $(FILES) ; do \
     64          $(INSTALL) -m 444  $$i $(destdir) ; \
     65        done
     66        for i in $(PROGS) ; do \
     67          $(INSTALL) -m 555 $$i $(destdir) ; \
     68        done
    4369
    44 plot: plot.cc
    45         @if test "`uname`" == "Darwin"; then \
    46                 $(CXX) $(DEBUG) -DDEBUG $(INCL_FILES) -o $@ $< $(LIB_RAPPTURE_MAC); \
    47         else \
    48                 $(CXX) $(DEBUG) -DDEBUG $(INCL_FILES) -o $@ $< $(LIB_RAPPTURE); \
    49         fi
    50 
    51 plotc: plotc.c
    52         @if test "`uname`" == "Darwin"; then \
    53                 $(CXX) $(DEBUG) -DDEBUG $(INCL_FILES) -o $@ $< $(LIB_RAPPTURE_MAC); \
    54         else \
    55                 $(CC) $(DEBUG) -DDEBUG $(INCL_FILES) -o $@ $< $(LIB_RAPPTURE) -lm; \
    56         fi
    57 
    58 #### CLEAN UP ############################################################
    5970clean:
    60         rm -f $(PROGS) run*.xml
     71        $(RM) $(PROGS) run*.xml
    6172
    6273distclean: clean
    63         - rm Makefile
     74        $(RM) Makefile *~
  • trunk/examples/c-example/plot.cc

    r872 r1019  
    1111#include <iostream>
    1212#include <sstream>
     13
     14#ifdef DEBUG
     15static int debug = 1;
     16#else
     17static int debug = 0;
     18#endif
    1319
    1420int main(int argc, char * argv[])
     
    2935    filePath = std::string(argv[1]);
    3036
    31     if (DEBUG) {
     37    if (debug) {
    3238        std::cout << "filePath: " << filePath << std::endl;
    3339    }
     
    3743
    3844    if (lib) {
    39         if(DEBUG) {
     45        if(debug) {
    4046            std::cout << "created Rappture Library successfully" << std::endl;
    4147        }
     
    5157
    5258    if(! (xmltext.empty()) ) {
    53         if(DEBUG) {
     59        if(debug) {
    5460        //printf("XML file content:\n");
    5561        //printf("%s\n", xmltext);
     
    7177    }
    7278
    73     if(DEBUG) {
     79    if(debug) {
    7480        std::cout << "xml min :" << xmltext << ": len=" << xmltext.size() << std::endl;
    7581    }
     
    7884    fmin = lib->getDouble("input.number(min).current");
    7985
    80     if(DEBUG) {
     86    if(debug) {
    8187        std::cout << "min: " << fmin << std::endl;
    8288    }
     
    8490    // get the max
    8591    fmax = lib->getDouble("input.(max).current");
    86     if(DEBUG) {
     92    if(debug) {
    8793        std::cout << "max: " << fmax << std::endl;
    8894    }
  • trunk/examples/c-example/plotc.c

    r555 r1019  
    1313#include <math.h>
    1414
    15 int main(int argc, char * argv[])
     15#ifdef DEBUG
     16static int debug = 1;
     17#else
     18static int debug = 0;
     19#endif
     20
     21int
     22main(int argc, char **argv)
    1623{
    1724
     
    3744    filePath = argv[1];
    3845
    39     if (DEBUG)
     46    if (debug)
    4047        printf("filePath: %s:\n", filePath);
    4148
     
    4451
    4552    if (lib) {
    46         if(DEBUG) {
     53        if(debug) {
    4754            printf("created Rappture Library successfully\n");
    4855        }
     
    5764    err = rpXml(lib,&xmltext);
    5865    if( !err ) {
    59         if(DEBUG) {
     66        if(debug) {
    6067        //printf("XML file content:\n");
    6168        //printf("%s\n", xmltext);
     
    7986    // it will live in rappture's memory until the next call to getString()
    8087
    81     if(DEBUG) {
    82         printf("xml min: %s: len=%d\n", xmltext, strlen(xmltext));
     88    if(debug) {
     89      printf("xml min: %s: len=%d\n", xmltext, (int)strlen(xmltext));
    8390    }
    8491
    8592    fmin = atof(xmltext);
    8693    // fmin = getDouble(lib,"input.number(min).current");
    87     if(DEBUG) {
     94    if(debug) {
    8895        printf("min: %f\n", fmin);
    8996    }
     
    9198    // get the max
    9299    rpGetDouble(lib,"input.(max).current",&fmax);
    93     if(DEBUG) {
     100    if(debug) {
    94101        printf("max: %f\n", fmax);
    95102    }
Note: See TracChangeset for help on using the changeset viewer.