UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor bonnefeld
Visitor
610 Views
Registered: ‎03-16-2018

PetaLinux 2017.4 Makefile Error with "ifndef PETALINUX"

After changing the Makefile I got an error when I rebuild the app. The problem are these lines:

 

ifndef PETALINUX

$(error "ERROR: PETALINUX environment variable not set. Change to the root of your PetaLinux install and source the settings.sh file")

endif

 

include apps.common.mk

 

So first I check if the environment variable is set with the command "echo $PETALINUX" and i got as feedback "/homer/user/PetaLinux". So I think is set.

 

Next I checked the Makefile if there was a mistake, but there isn't a tab or blank in front of the lines.

So it should be right.

 

After checking some forums I found no solution, so any idea?

0 Kudos
2 Replies
Moderator
Moderator
558 Views
Registered: ‎12-04-2016

Re: PetaLinux 2017.4 Makefile Error with "ifndef PETALINUX"

Hi

 

Can you please provide the Makefile and application thats causing this issue? 

 

 

Best Regards

Shabbir

0 Kudos
Visitor bonnefeld
Visitor
547 Views
Registered: ‎03-16-2018

Re: PetaLinux 2017.4 Makefile Error with "ifndef PETALINUX"

It is a zynq system and I create a normal application with

"petalinux-create -t apps --name <APP_Name> --enable".

I get the error when I modificate the Makefile for the default application.

 

The Makefile looks like this:

 

ifndef PETALINUX
$(error "Error: PETALINUX environment variable not set. Change to the root of your PetaLinux install, and source the settings.sh file")
endif

 

include apps.common.mk

 

APP = testapp

 

# Add any other object files to this list below
APP_OBJS = testapp.o \

all: build install

 

build: $(APP)

 

$(APP): $(APP_OBJS)
$(CC) $(LDFLAGS) -o $@ $(APP_OBJS) $(LDLIBS)

 

clean:
-rm -f $(APP) *.elf *.gdb *.o

 

.PHONY: install image

 

install: $(APP)
$(TARGETINST) -d $(APP) /bin/$(APP)

 

%.o: %.c
$(CC) -c $(CFLAGS) -o $@ $<

 

help:
@echo ""
@echo "Quick reference for various supported build targets for $(INSTANCE)."
@echo "----------------------------------------------------"
@echo " clean clean out build objects"
@echo " all build $(INSTANCE) and install to rootfs host copy"
@echo " build build subsystem"
@echo " install install built objects to rootfs host copy"

0 Kudos