Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6718027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:55:18+00:00 2026-05-26T08:55:18+00:00

I have a makefile that I am using to generate artifacts using a third

  • 0

I have a makefile that I am using to generate artifacts using a third party IDL compiler (rtiddsgen). This takes in idl files and spits out C/Ada files relating to them. The C files are then compiled and put into a library (idl_dds_types.a)

I have the IDL files listed in the IDL_TYPES variable. Each IDL_TYPES file will generate (through rtiddsgen) files of the following form (For example with alerts.idl):

alerts.c
alerts.h
alerts_idl.ads
alerts_idl.adb

So, what I want to happen is when alerts.idl’s timestamp is newer than the alerts.c (or the obj.Linux-i686/alerts.o) file, then the alerts.c file is regenerated. This doesn’t seem to be happening. Any ideas what I need to do to make this happen? I’ve tested by “touch”-ing the idl file and then re-running make.

Here is the makefile:

DDS_OUT_DIR = $(MY_HOME)/DDS/DDS_Types/src

IDL_DIR=$(MY_HOME)/DDS/DDS_Types/IDL
IDL_TYPES=common.idl alerts.idl summary.idl
GENERATED_SOURCES =  $(IDL_TYPES:%.idl=%.c)
GENERATED_HEADERS =  $(IDL_TYPES:%.idl=%.h)

LIBNAME  = idl_dds_types

OBJS_DIR       = obj.$(CPUTYPE)

GENERATED_OBJS = $(GENERATED_SOURCES:%.c=$(OBJS_DIR)/%.o)

LIBDIR   = $(DDS_OUT_DIR)/../../lib.$(CPUTYPE)
BINDIR   = $(DDS_OUT_DIR)/../../../../bin.$(CPUTYPE)
CC       = $(C_COMPILER)
CXX      = $(CPP_COMPILER)
OS       = $(shell uname)
DDSCOMMON = $(DDS_OUT_DIR)/../../Common/src

CFLAGS   = -m32 -g -DRTI_UNIX -DRTI_32BIT
CXXFLAGS = -m32 -g
LDFLAGS  = -m32 -static-libgcc
SYSLIBS  = -ldl -lnsl -lpthread -lm -lc


DEFINES_ARCH_SPECIFIC = -DRTI_UNIX

DEFINES = $(DEFINES_ARCH_SPECIFIC) $(cxx_DEFINES_ARCH_SPECIFIC)

INCLUDES  = -I. -I$(NDDSHOME)/include -I$(NDDSHOME)/include/ndds
INCLUDES += -I$(DDSCOMMON)

LIBS = -L$(NDDSLIBDIR) -L$(LIBDIR) -lrt \
      -lnddscppz -lnddscz -lnddscorez $(SYSLIBS) $(OS_SPECIFIC_LIBS)

COMMONLIBSRC  = $(DDSCOMMON)/dds_common.cxx
COMMONLIBOBJS = $(DDSCOMMON)/obj.$(CPUTYPE)/%.o

$(shell mkdir -p $(OBJS_DIR) $(DDSCOMMON)/obj.$(CPUTYPE) $(DDS_CPP_DIR))

default:        $(GENERATED_OBJS) $(LIBDIR)/lib$(LIBNAME).a

$(OBJS_DIR)/%.o : %.idl $(DDSCOMMON)/dds_common.h
       $(C_COMPILER)  -o $(OBJS_DIR)/$(*F).o $(DEFINES) $(INCLUDES) $(CFLAGS) -c $(*F).c; \
       $(C_COMPILER)  -o $(OBJS_DIR)/$(*F)Support.o $(DEFINES) $(INCLUDES) $(CFLAGS) -c $(*F)Support.c; \
       $(C_COMPILER)  -o $(OBJS_DIR)/$(*F)Plugin.o $(DEFINES) $(INCLUDES) $(CFLAGS) -c $(*F)Plugin.c; \

$(LIBDIR)/lib$(LIBNAME).a: $(GENERATED_OBJS) $(CPP_OBJS)
       @echo "Adding these to lib: " $(OBJS_DIR)/*.o; \
       mkdir -p $(LIBDIR)
       rm -f $(LIBDIR)/lib$(LIBNAME).a
       $(AR) -cr $(LIBDIR)/lib$(LIBNAME).a $(OBJS_DIR)/*.o
       ranlib $(LIBDIR)/lib$(LIBNAME).a

%.idl:
       @echo "Generating C and Ada from $@ ..."; \
       $(NDDSHOME)/scripts/rtiddsgen ${IDL_DIR}/$@ -d $(DDS_OUT_DIR) -I ${IDL_DIR} -replace -language Ada; # -example i86Linux2.6gcc4.1.2;



clean:
       rm -rf $(LIBDIR)/lib$(LIBNAME).a; \
       rm -rf $(DDS_OUT_DIR)/*.h; \
   rm -rf $(DDS_OUT_DIR)/*.c; \
       rm -rf $(DDS_OUT_DIR)/*.gpr; \
       rm -rf $(DDS_OUT_DIR)/samples; \
       rm -rf $(DDS_OUT_DIR)/*.xml; \
       rm -rf $(DDS_OUT_DIR)/makefile_*; \
       rm -rf $(DDS_OUT_DIR)/bin; \
       rm -rf $(DDS_OUT_DIR)/summary_idl*; \
       rm -rf $(DDS_OUT_DIR)/common_idl*; \
       rm -rf $(DDS_OUT_DIR)/alerts_idl*; \
       rm -rf $(DDS_OUT_DIR)/$(OBJS_DIR);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:55:18+00:00Added an answer on May 26, 2026 at 8:55 am

    A rule like your %.idl: rule tells make how to generate .idl files, not how to generate things from .idl files. You want to change this to %.c: %.idl — how to generate .c files from .idl files.

    That will do most of what you want — the only problem is if you ever want to be able to generate .ads/.adb files WITHOUT generating .c files or rebuilding the library.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a makefile project that builds and links a DLL, using the command-line
I have a Makefile that looks like this CXX = g++ -O2 -Wall all:
I have a section of makefile that has this sort of structure: bob: ifdef
I have a working makefile that builds with mingw32. Now i renamed that makefile
I have a project that has a makefile with broken dependencies. Is there any
I have some demos that I downloaded and they come with a Makefile.win and
In a makefile, I have the following line: helper.cpp: dtds.h Which ensures that helper.cpp
I have a Makefile building many C files with long long command lines and
I'm using a makefile intending to generate dependencies automatically. But with my file, I
I have a project that can be built via makefile, and I would like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.