Visit The New, Modern Unix Linux Community


[Makefile]File + constant problem


 
Thread Tools Search this Thread
Top Forums Programming [Makefile]File + constant problem
# 1  
[Makefile]File + constant problem

Hi guys,
I am writing a Makefile with some strange features.
What I have is:
list of files *.efi
list of guids (guid is just a number)

one *.efi file is supposed to be used with one guid, so efi file and guid is a pair.

What I need is:
list of files *.fv

How to make *.fv file from *.efi file?
Code:
 
$(SOME_COMMAND)  efi_file -some_flags   # produces *.efi.xyz file
$(ANOTHER_COMMAND) efi_xyz_file -some_flags guid # produces *.fv file

So $(SOME_COMMAND) and ($ANOTHER_COMMAND) must be done for each of *.efi - guid pair.

E.g

Code:
 
files = first.efi second.efi
guid = 544 123
 
#what must be done is:
$(SOME_COMMAND)  first.efi -some_flags   # produces first.efi.xyz file
$(ANOTHER_COMMAND) first.efi.xyz -some_flags 544 # prudces first.fv
 
$(SOME_COMMAND)  second.efi -some_flags   # produces second.efi.xyz file
$(ANOTHER_COMMAND) second.efi.xyz -some_flags 123 # produces second.fv

Do you have any concept how to prepare such a makefile? I tried with for loop but it's not designed to be used inside makefiles...
# 2  
Are you using Gnu make as that tool is very powerful and features loops...creating pipeline of complex commands etc. so check it out.

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #225
Difficulty: Easy
In September 2019, according to NetMarketShare, Google commanded over 90% market share for desktop search engines.
True or False?

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Reading from one file and updating other file with constant entries

Hi All, Thaks for the help in my last thread. I have one more question. I have two files with ldap entries in it. One file contains all the user LDAP parameter entries (26 MB) and other file contains only the user id's that have to be inactivated. Unix script has to read from the file that has... (8 Replies)
Discussion started by: Samingla
8 Replies

2. Emergency UNIX and Linux Support

Problem With Makefile

I had created a Makefile for my project. my project file hierarchy is like this: 1. a source folder with main.c and Makefile in it 2. and a top level Makefile here is the Makefile in src folder all: program program: main.c gcc -o program main.c clean: rm programand here is top... (3 Replies)
Discussion started by: majid.merkava
3 Replies

3. Programming

Problem with Makefile

Hi, Here is my makefile http://pastie.org/1104332. I am trying to compile different .c files and .s files (assembly files) from different sub directories into E:/em35x/build/mfg-sample-app-cortexm3-iar-em357-em3xx-dev0680/ then the linker should link all the .o files from the build directory... (1 Reply)
Discussion started by: blade2008
1 Replies

4. UNIX for Advanced & Expert Users

Makefile problem - How to run module load in a Makefile

Hi, I'm trying to run the module load command in a Makefile and i'm getting the following error: make: module: command not found Why is this? Is there any way to run this command in a Makefile? NOTE: command - module load msjava/sunjdk/1.5.0 works fine outside of the Makefile (2 Replies)
Discussion started by: hernandinho
2 Replies

5. Programming

Problem with makefile

My make file is CFLAGS = -Wall -g LDFLAGS = -lm CC = g++ all: server client rc4.o: rc4.cpp rc4.h ${CC} ${CFLAGS} -c rc4.cpp server.o: server.cpp rc4.h ${CC} ${CFLAGS} -c .cpp client.o: client.cpp rc4.h ${CC} ${CFLAGS} -c client.cpp server: server.o... (2 Replies)
Discussion started by: neerajgoyal12
2 Replies

6. Programming

Problem with a Makefile

Hi, I am very new with makefile topics , maybe this is a very symple question... I have this code wich compile very good ( I get it from the net), I will call it code A. I have to add it with a program that is all ready in use, (code B) that also compile good. When I put together it doesnt... (7 Replies)
Discussion started by: pmoren
7 Replies

7. Programming

File descriptor constant

I have a requirement to close all the file descriptors from 3 to 1024 for a particular application. Right now, this is how I do it .. for ( int i = 3 ; i <= 1024; ++i ) close(i); The change I am looking at is, I want to do away with the number 1024 and replace it with a constant which... (4 Replies)
Discussion started by: vino
4 Replies

Featured Tech Videos