Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. I've used rake a bit a Ruby make program , and it has an option to get a list of all the available targets, eg. Anyway, I made little hack to extract the targets from a makefile, which you can include in a makefile. It will give you a list of the defined targets.
It's just a start - it doesn't filter out the dependencies, for instance. This is an attempt to improve on nobar's great approach as follows:. Curiously, GNU make has no feature for listing just the names of targets defined in a makefile. The -p option produces output that includes all targets, but buries them in a lot of other information. Place the following rule in a makefile for GNU make to implement a target named list that simply lists all target names in alphabetical order - i.
Important : On pasting this, make sure that the last line is indented by exactly 1 actual tab char. Note that sorting the resulting list of targets is the best option, since not sorting doesn't produce a helpful ordering in that the order in which the targets appear in the makefile is not preserved. Also, the sub-targets of a rule comprising multiple targets are invariably output separately and will therefore, due to sorting, usually not appear next to one another; e. Running make list then prints all targets, each on its own line; you can pipe to xargs to create a space-separated list instead.
This obviously won't work in many cases, but if your Makefile was created by CMake you might be able to run make help. This function is meant to create a sed script which can be used to obtain the targets as a list.
As mklement0 points out , a feature for listing all Makefile targets is missing from GNU-make, and his answer and others provides ways to do this. However, the original post also mentions rake , whose tasks switch does something slightly different than just listing all tasks in the rakefile. Rake will only give you a list of tasks that have associated descriptions. Tasks without descriptions will not be listed.
About targets for Dynamic Search Ads
This gives the author the ability to both provide customized help descriptions and also omit help for certain targets. If you want to emulate rake's behavior, where you provide descriptions for each target , there is a simple technique for doing this: embed descriptions in comments for each target you want listed. You can either put the description next to the target or, as I often do, next to a PHONY specification above the target, like this:. You can also find a short code example in this gist and here too.
Primary goal Target applies to:
Again, this does not solve the problem of listing all the targets in a Makefile. For example, if you have a big Makefile that was maybe generated or that someone else wrote, and you want a quick way to list its targets without digging through it, this won't help. However, if you are writing a Makefile, and you want a way to generate help text in a consistent, self-documenting way, this technique may be useful. This works great for platforms that provide this functionality by default e. On other platforms e. I'll quote. User Brainstone suggests piping to sort -u to remove duplicate entries:.
Source: How to list all targets in make? This one was helpful to me because I wanted to see the build targets required and their dependencies by the make target. I know that make targets cannot begin with a ". I don't know what languages are supported, so I went with egrep's bracket expressions. I use make -p that dumps the internal database, ditch stderr, use a quick and dirty grep -A to keep the bottom of the output.
Then I clean the output with a couple of grep -v , and finally use cut to get what's before the colon, namely, the targets. Plenty of workable solutions here, but as I like saying, "if it's worth doing once, it's worth doing again. I have not tested the below with sub-makes I think it wouldn't work. As we know, recursive makes considered harmful.
I like the idea of getting not only a list of targets but also their descriptions. So instead, I extract the description from the echo command for each target. Note that the ordering of the parameters matters! This means the following are invalid which is different to pre FAKE 5 versions : fake run -t Target build.
This is because there is no -v in the above CLI. In general you should use the command-line in a way to not be broken when new parameters are added. Use longer forms in your scripts and shorter forms on your shell! FAKE has a special param "target" which can be used to run specific targets in a build.http://pierreducalvet.ca/150421.php
The fly CLI - Concourse CI
We assume the following build script build. We decided to change the syntax here to introduce some parameters or other features at a later point. Using the current parameter object is not supported yet. You can set the build status automatically using Target. To do this you need to use the Target. WithContext functions to run a target and retrieve the context information:. Final targets can be used for TearDown functionality. These targets will be executed even if the build fails but have to be activated via Target. Build failure targets can be used to execute tasks after a build failure.
These targets will be executed only after a build failure but have to be activated via activateBuildFailure. Since multithreading is beneficial especially for large projects FAKE allows to specify the number of threads used for traversing the dependency tree. This option of course only affects independent targets whereas dependent targets will still be executed in order.
Added another file, only one checkbox was checked. Strange, works for me. Xcode 4. I'm on 4. I look forward to my upgrade! Does not remember for me. Xcode Version 4. Xcode remembers until you quit the app. Sign up or log in Sign up using Google.
Sign up using Facebook.