Skip to content
Snippets Groups Projects
Select Git revision
  • 9491d87fe15fa6aaade3e68e5a1f550b3ab5e8f4
  • master default
  • labcomm2006
  • typedefs
  • anders.blomdell
  • typeref
  • pragma
  • compiler-refactoring
  • labcomm2013
  • v2014.4
  • v2006.0
  • v2014.3
  • v2014.2
  • v2014.1
  • v2014.0
  • v2013.0
16 results

Makefile

Blame
  • Forked from Anders Blomdell / LabComm
    Source project has a limited visibility.
    Makefile 4.37 KiB
    ## Macros
    UNAME_S=$(shell uname -s)
    ALL_DEPS=liblabcomm.a liblabcomm.so.1
    
    ifeq ($(UNAME_S),Linux)
      CFLAGS=-std=c99 -g -Wall -Werror -O3  -I. -Itest
      ifndef TARGET
        CC=gcc	
      else ifeq ($(TARGET),vx)
        CC=i586-wrs-vxworks-gcc
        LD=i586-wrs-vxworks-ld
        ALL_DEPS:=$(filter-out %.so.1, $(ALL_DEPS))
        CFLAGS:=$(CFLAGS) -DLABCOMM_COMPAT=\"labcomm_compat_vxworks.h\" -DLABCOMM_NO_STDIO
      else
        @echo 'Invalid target.'
      endif
      LDFLAGS=-L.
      LDLIBS=-llabcomm -lrt
      MAKESHARED=gcc -o $1 -shared -Wl,-soname,$2 $3 -lc -lrt
    else ifeq ($(UNAME_S),Darwin)
      CC=clang
      CFLAGS=-g -Wall -Werror -O3  -I. -Itest \
    	 -DLABCOMM_COMPAT=\"labcomm_compat_osx.h\" \
    	 -Wno-tautological-compare -Wno-unused-function
      LDFLAGS=-L.
      LDLIBS=-llabcomm
      MAKESHARED=clang -o $1 -shared -Wl,-install_name,$2 $3 -lc
    else
      $(error Unknown system $(UNAME_S))
    endif
    
    OBJS=labcomm_memory.o \
         labcomm_error.o \
         labcomm_default_error_handler.o \
         labcomm_default_memory.o \
         labcomm_default_scheduler.o \
         labcomm_time.o labcomm_scheduler.o \
         labcomm_encoder.o labcomm_decoder.o \
         labcomm.o \
         labcomm_dynamic_buffer_writer.o \
         labcomm_fd_reader.o labcomm_fd_writer.o \
         labcomm_pthread_scheduler.o 
    
    #FIXME: labcomm_mem_reader.o labcomm_mem_writer.o
    LABCOMM_JAR=../../compiler/labComm.jar
    LABCOMM=java -jar $(LABCOMM_JAR) 
    
    TESTS=test_labcomm_basic_type_encoding test_labcomm_generated_encoding \
          test_signature_numbers \
          test_labcomm \
          test_labcomm_pthread_scheduler \
    #
    #FIXME: test_labcomm test_labcomm_errors
    TEST_DIR=test
    
    VPATH=$(TEST_DIR)
    
    # Enable experimental objects by invoking make like `make LABCOMM_EXPERIMENTAL=true`
    ifeq ($(LABCOMM_EXPERIMENTAL),true)
    	OBJS += experimental/udp_hack.o experimental/ethaddr.o \
    		experimental/labcomm_thr_reader_writer.o \
    		experimental/ThrottleDrv/ethernet_drv.o \
    		experimental/ThrottleDrv/throttle_drv.o \
    		experimental/labcomm_udp_reader_writer.o
    endif
    
    ## Targets
    
    .PHONY: all run-test clean distclean