mirror of
https://github.com/nasa/trick.git
synced 2024-12-24 07:16:41 +00:00
14a75508a3
Changed all header file once include variables to follow the same naming convention and not start with any underscores. Also deleted old incorrect copyright notices. Also removed $Id: tags from all files. Fixes #14. Fixes #22.
1.4 KiB
1.4 KiB
#
# This makefile is used to build trick utils standalone.
# That is, without Trick.
#
TRICK_HOST_CPU := $(shell uname -s)
CC = cc
CPP = c++
UNITS_INC_DIR = include
OBJ_DIR = object_${TRICK_HOST_CPU}
UNITS_LIB = $(OBJ_DIR)/libtrick_units.a
FLAGS = -g -I../include -D_REENTRANT -DSTAND_ALONE
CFLAGS = ${FLAGS} -I./include
CPPFLAGS = ${FLAGS} -I./include
trick: start
start: $(UNITS_LIB)
@ echo "$(UNITS_LIB) is up to date"
real_clean: clean
clean:
/bin/rm -rf $(OBJ_DIR)
#=======================================================================
# UNITS
SRC_DIR = src
UNITS_OBJECTS = $(OBJ_DIR)/units_conv.o \
$(OBJ_DIR)/UCFn.o \
$(OBJ_DIR)/Unit.o
$(UNITS_LIB): $(UNITS_OBJECTS)
ar cr $(UNITS_LIB) $?
@ if [ "${TRICK_RANLIB}" != "" ] ; then \
echo ${TRICK_RANLIB} $(UNITS_LIB) ; \
${TRICK_RANLIB} $(UNITS_LIB) ; \
fi
$(OBJ_DIR):
mkdir -p $(OBJ_DIR)
$(OBJ_DIR)/units_conv.o: ${SRC_DIR}/units_conv.c | $(OBJ_DIR)
$(CC) ${CFLAGS} -c src/units_conv.c -o $@
$(OBJ_DIR)/UCFn.o: ${SRC_DIR}/UCFn.cpp | $(OBJ_DIR)
$(CPP) ${CPPFLAGS} -c src/UCFn.cpp -o $@
$(OBJ_DIR)/Unit.o: ${SRC_DIR}/Unit.cpp | $(OBJ_DIR)
$(CPP) ${CPPFLAGS} -c src/Unit.cpp -o $@
#----------------------------
# Header Dependencies
$(OBJ_DIR)/UCFn.o: ${UNITS_INC_DIR}/UCFn.hh
$(OBJ_DIR)/Unit.o: ${UNITS_INC_DIR}/Unit.hh ${UNITS_INC_DIR}/units_conv.h
$(OBJ_DIR)/units_conv.o: ${UNITS_INC_DIR}/units_conv.h