473,397 Members | 2,077 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Makefile with flags

Hi,
Small question regarding makefiles:
I want to add a new target: release
that will compile my driver with additional flag
(EXTRA_CFLAGS += -Drelease_flag)

how can i do that on this example:


KERNELPATH := /home/kernel-2.6.24/

.PHONY: all clean
EXTRA_CFLAGS += -Werror
EXTRA_CFLAGS += -I$(src)/dir1
EXTRA_CFLAGS += -I$(src)/dir2

all: modules
obj-m := driver.o
driver-objs := file1.o
driver-objs += file2.o

modules:
make -C $(KERNELPATH) M=$(PWD) modules

clean:
make -C $(KERNELPATH) M=$(PWD) clean

thanks
Jan 26 '09 #1
3 5163
ashitpro
542 Expert 512MB
@amitbern
Can't you do something like this:

release:
make -C $(KERNELPATH) M=$(PWD) -Drelease_flag modules

Regards,
Ash
Jan 27 '09 #2
tried.. not working.. :(
Jan 28 '09 #3
ashitpro
542 Expert 512MB
@amitbern
What error does it gives?
First of all make sure whether that "make" (after release) is valid.
You can put "echo" statements inside release, so that you can debug the make file..

Regards,
Ash
Jan 28 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Fernando Silva | last post by:
Hello! Because I don't have access to CC compiler I need to change a example Makefile to use gcc (version 2.95.2) in order to compile some code. But until now I didn't had any success in being...
2
by: Juhan Voolaid | last post by:
Hello I need help with my makefile, so that when I compile my project the source code files would be separated from the object (*.o) files. So if I have: main.cpp and classes.cpp - the...
5
by: Jacobo Rodriguez Villar | last post by:
Hello, Is there any way (or program) to convert and maintain easily a C++ project (vs7.1) to a Makefile file, in order to build it in Linux? Many thanks -- Jacobo Rodríguez Villar ...
4
by: Jess | last post by:
Hello, I am now trying to use makefile to compile C++ programs. My makefile looks like: f1.o : f1.cpp h1.h h2.h g++ -c f1.cpp f2.o : f2.cpp h2.h h3.h g++ -c f2.cpp
7
by: HT-Lab | last post by:
Hi All, Not strictly a C++ question but I am sure this is a common compile issue :-) I have a generic makefile (see below) that I would like update such that if I make some changes to a header...
8
by: xz | last post by:
I am a rookie of C++ and got so confused with the Makefile these days. Could anyone be so kind and give a little sample Makefile for the following particular example? Let's say I have the...
1
by: rpjanaka | last post by:
I am using an open source library called IGI_UDP for measure the available bandwidth of a link (http://www.cs.cmu.edu/%7Ehnn/igi/ ). with that library they have provided a "Makefile" which is not an...
5
by: M.Liang Liu | last post by:
I have a project with the following dirs: --------------------------------------------------------------------------------------- +src |-proj0 |-program1 |-program2 |-proj1 |-program1...
2
by: pereges | last post by:
This was a makefile written by a friend of mine using tcc as the compiler. What would like to know is how are the makefiles written for a different compiler (like say, gcc) would be different ? ...
2
by: chutsu | last post by:
I'm basically a summer student working on a program called Rivet. (http://projects.hepforge.org/rivet/) And I'm trying to port it to BOINC so that the hosts can download the BOINC client and do...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.