mirror of
https://github.com/nasa/trick.git
synced 2024-12-18 20:57:55 +00:00
Fix a race condition between ICG and mongoose install (#891)
* Fix a race condition between ICG and mongoose install * Update mongoose to version 6.16
This commit is contained in:
parent
95c6659733
commit
d86a23834c
35
Makefile
35
Makefile
@ -183,8 +183,8 @@ $(ER7_UTILS_DIRS): icg_sim_serv
|
|||||||
# 1.1.1.4 Generate interface code (using ICG) for the specified sim_services
|
# 1.1.1.4 Generate interface code (using ICG) for the specified sim_services
|
||||||
# header files.
|
# header files.
|
||||||
.PHONY: icg_sim_serv
|
.PHONY: icg_sim_serv
|
||||||
icg_sim_serv: $(ICG_EXE)
|
icg_sim_serv: $(ICG_EXE) ${TRICK_HOME}/include/mongoose/mongoose.h
|
||||||
${TRICK_HOME}/bin/trick-ICG -sim_services -m ${TRICK_CXXFLAGS} ${TRICK_SYSTEM_CXXFLAGS} ${TRICK_HOME}/include/trick/files_to_ICG.hh
|
${ICG_EXE} -sim_services -m ${TRICK_CXXFLAGS} ${TRICK_SYSTEM_CXXFLAGS} ${TRICK_HOME}/include/trick/files_to_ICG.hh
|
||||||
|
|
||||||
# 1.1.1.4.1 Build the Interface Code Generator (ICG) executable.
|
# 1.1.1.4.1 Build the Interface Code Generator (ICG) executable.
|
||||||
$(ICG_EXE) :
|
$(ICG_EXE) :
|
||||||
@ -211,9 +211,34 @@ dp: ${TRICK_HOME}/trick_source/trick_utils/units
|
|||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
.PHONY: webserver
|
.PHONY: webserver
|
||||||
webserver:
|
webserver: ${TRICK_LIB_DIR}/libmongoose.a ${TRICK_HOME}/include/mongoose/mongoose.h
|
||||||
@ $(MAKE) -C ${TRICK_HOME}/trick_source/web/HttpServer
|
@ $(MAKE) -C ${TRICK_HOME}/trick_source/web/HttpServer
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
TRICK_ICG_EXCLUDE += ${TRICK_HOME}/include/mongoose
|
||||||
|
|
||||||
|
mongoose.h:
|
||||||
|
curl --retry 4 -O https://raw.githubusercontent.com/cesanta/mongoose/6.16/mongoose.h
|
||||||
|
|
||||||
|
mongoose.c:
|
||||||
|
curl --retry 4 -O https://raw.githubusercontent.com/cesanta/mongoose/6.16/mongoose.c
|
||||||
|
|
||||||
|
mongoose.o: mongoose.h mongoose.c
|
||||||
|
$(CC) $(TRICK_CFLAGS) -c -o mongoose.o mongoose.c
|
||||||
|
rm mongoose.c
|
||||||
|
|
||||||
|
${TRICK_LIB_DIR}/libmongoose.a: mongoose.o ${TRICK_HOME}/include/mongoose/mongoose.h | $(TRICK_LIB_DIR)
|
||||||
|
ar crs $@ mongoose.o
|
||||||
|
rm mongoose.o
|
||||||
|
rm mongoose.h
|
||||||
|
@ echo ; echo "Mongoose library compiled:" ; date
|
||||||
|
|
||||||
|
${TRICK_HOME}/include/mongoose/mongoose.h: mongoose.h | ${TRICK_HOME}/include/mongoose
|
||||||
|
@ cp mongoose.h $@
|
||||||
|
|
||||||
|
${TRICK_HOME}/include/mongoose:
|
||||||
|
@ mkdir $@
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# 1.3 Build Trick's Java Tools
|
# 1.3 Build Trick's Java Tools
|
||||||
java:
|
java:
|
||||||
@ -392,8 +417,8 @@ uninstall:
|
|||||||
################################################################################
|
################################################################################
|
||||||
# ICG all sim_services files (for testing and debugging ICG).
|
# ICG all sim_services files (for testing and debugging ICG).
|
||||||
# The -f flag forces io_src files to be regenerated whether or not they need to be.
|
# The -f flag forces io_src files to be regenerated whether or not they need to be.
|
||||||
ICG: $(ICG_EXE)
|
ICG: $(ICG_EXE) ${TRICK_HOME}/include/mongoose/mongoose.h
|
||||||
${TRICK_HOME}/bin/trick-ICG -f -s -m -n ${TRICK_CXXFLAGS} ${TRICK_SYSTEM_CXXFLAGS} ${TRICK_HOME}/include/trick/files_to_ICG.hh
|
$(ICG_EXE) -f -s -m -n ${TRICK_CXXFLAGS} ${TRICK_SYSTEM_CXXFLAGS} ${TRICK_HOME}/include/trick/files_to_ICG.hh
|
||||||
|
|
||||||
# This builds a tricklib share library.
|
# This builds a tricklib share library.
|
||||||
trick_lib: $(SIM_SERV_DIRS) $(UTILS_DIRS) | $(TRICK_LIB_DIR)
|
trick_lib: $(SIM_SERV_DIRS) $(UTILS_DIRS) | $(TRICK_LIB_DIR)
|
||||||
|
@ -19,9 +19,6 @@ INCDIR = include
|
|||||||
|
|
||||||
#TRICK_LIB_DIR comes from Makefile.common
|
#TRICK_LIB_DIR comes from Makefile.common
|
||||||
|
|
||||||
MONGOOSE_OBJS = ${OBJDIR}/mongoose.o
|
|
||||||
MONGOOSE_INCDIR = ${TRICK_HOME}/include/mongoose
|
|
||||||
|
|
||||||
TRICK_HTTP_OBJS = \
|
TRICK_HTTP_OBJS = \
|
||||||
${OBJDIR}/VariableServerSession.o \
|
${OBJDIR}/VariableServerSession.o \
|
||||||
${OBJDIR}/VariableServerVariable.o \
|
${OBJDIR}/VariableServerVariable.o \
|
||||||
@ -33,56 +30,19 @@ TRICK_HTTP_OBJS = \
|
|||||||
## MODEL TARGETS ##
|
## MODEL TARGETS ##
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
all: build_libs
|
all: ${TRICK_LIB_DIR}/libtrickHTTP.a
|
||||||
|
|
||||||
build_libs: ${TRICK_LIB_DIR}/libmongoose.a ${TRICK_LIB_DIR}/libtrickHTTP.a
|
$(TRICK_HTTP_OBJS): $(OBJDIR)/%.o : src/%.cpp | $(OBJDIR)
|
||||||
|
|
||||||
${TRICK_LIB_DIR}/libmongoose.a: ${LIBDIR}/libmongoose.a ${MONGOOSE_INCDIR}/mongoose.h
|
|
||||||
$(MV) ${LIBDIR}/libmongoose.a ${TRICK_LIB_DIR}
|
|
||||||
|
|
||||||
${TRICK_LIB_DIR}/libtrickHTTP.a: ${LIBDIR}/libtrickHTTP.a
|
|
||||||
$(MV) ${LIBDIR}/libtrickHTTP.a ${TRICK_LIB_DIR}
|
|
||||||
|
|
||||||
${MONGOOSE_INCDIR}/mongoose.h: mongoose.h | ${MONGOOSE_INCDIR}
|
|
||||||
$(CP) mongoose.h ${MONGOOSE_INCDIR}/mongoose.h
|
|
||||||
|
|
||||||
${MONGOOSE_INCDIR}:
|
|
||||||
$(MKDIR) -p ${MONGOOSE_INCDIR}
|
|
||||||
|
|
||||||
# Build Mongoose Library
|
|
||||||
mongoose.h:
|
|
||||||
$(CURL) --retry 4 -O https://raw.githubusercontent.com/cesanta/mongoose/master/mongoose.h
|
|
||||||
|
|
||||||
mongoose.c:
|
|
||||||
$(CURL) --retry 4 -O https://raw.githubusercontent.com/cesanta/mongoose/master/mongoose.c
|
|
||||||
|
|
||||||
${MONGOOSE_OBJS}: mongoose.h mongoose.c | $(OBJDIR)
|
|
||||||
$(CC) $(CFLAGS) -c -o ${MONGOOSE_OBJS} mongoose.c
|
|
||||||
|
|
||||||
${LIBDIR}/libmongoose.a: ${MONGOOSE_OBJS} | ${LIBDIR}
|
|
||||||
ar crs $@ ${MONGOOSE_OBJS}
|
|
||||||
|
|
||||||
|
|
||||||
# Build Trick HTTP Server Library
|
|
||||||
$(TRICK_HTTP_OBJS): $(OBJDIR)/%.o : src/%.cpp ${MONGOOSE_INCDIR}/mongoose.h | $(OBJDIR)
|
|
||||||
$(CPP) $(CPPFLAGS) ${INCLUDE_DIRS} -c $< -o $@
|
$(CPP) $(CPPFLAGS) ${INCLUDE_DIRS} -c $< -o $@
|
||||||
|
|
||||||
${LIBDIR}/libtrickHTTP.a: ${TRICK_HTTP_OBJS} | ${LIBDIR}
|
${TRICK_LIB_DIR}/libtrickHTTP.a: ${TRICK_HTTP_OBJS}
|
||||||
ar crs $@ ${TRICK_HTTP_OBJS}
|
ar crs $@ ${TRICK_HTTP_OBJS}
|
||||||
|
|
||||||
# ---------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
${OBJDIR}:
|
${OBJDIR}:
|
||||||
mkdir -p ${OBJDIR}
|
mkdir -p ${OBJDIR}
|
||||||
|
|
||||||
${LIBDIR}:
|
|
||||||
mkdir -p ${LIBDIR}
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
${RM} *~
|
${RM} *~
|
||||||
${RM} ${OBJDIR}
|
${RM} ${OBJDIR}
|
||||||
|
|
||||||
spotless: clean
|
|
||||||
${RM} ${LIBDIR}
|
|
||||||
${RM} mongoose.h mongoose.c
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user