0

I have a project, that produces multiple binaries in bin/ directory.

The project dir looks like this:

    bin/ app1/ app2/ app3/ Makefile.am configure.ac

When I do make all, all the targets are compiled. But when I do e.g. make app1, it just says Nothing to be done for 'app1' and compiles nothing.

Makefile.am files of apps look like this:

    bin_PROGRAMS = $(top_builddir)/bin/app1
    __top_builddir__bin_app1_SOURCES = app1.c

Anyone know how to accomplish this? Thanks!

RobSis
  • 342
  • 2
  • 10

1 Answers1

0

The problem is that you have a directory named "app1" so doing "make app1" will check if a file named "app1" exists and exit when it finds the directory.

You may try to define a custom target app1

.PHONY: app1
app1: $(top_builddir)/bin/app1

BTW. The line

  __top_builddir__bin_app1_SOURCES = app1.c
is most likely wrong (unless app1.c is a generated source code). Refer to sources via top_srcdir, otherwise your build will be broken if srcdir != builddir
arved
  • 4,401
  • 4
  • 30
  • 53
  • I tried to add the phony target and it says No rule to make target 'bin/app1', needed by 'app1'. Stop. Also, the way you wrote it, shouldn't 'make app1' _run_ the binary, not compile it? – RobSis Nov 19 '13 at 10:16