Pages

Showing posts with label build. Show all posts
Showing posts with label build. Show all posts

Friday, November 30, 2012

Building eclipse source base and resolving its related issues

1. Download the eclipse source from CVS

You have to Checkout project from CVS Repository, refer to http://wiki.eclipse.org/CVS_Howto

ScreenShot2012-11-30at2.54.33PM-2012-11-30-14-53.png

Based on your workspace, you’ll have e4 directory that has many eclipse projects.

ScreenShot2012-11-30at3.00.13PM-2012-11-30-14-53.png

It’ll start building when you setup automatic build.

PastedGraphic1-2012-11-30-14-53.png

PastedGraphic-2012-11-30-14-53.png

2. Removing “API Baselines error”

After the automatic build, you may see a lot of “red !” and “red X” marks in some of the projects.

Refer to http://stackoverflow.com/questions/13650375/the-red-mark-after-the-build-in-eclipse. For your conveniences in debugging, you need to setup the filter. http://stackoverflow.com/a/13651021/260127

You’ll have “Adding API Baseline in eclipse” error.

http://stackoverflow.com/questions/13651144/adding-api-baseline-in-eclipse

You can remove all the errors by making “Missing API baseline” as warning.

PastedGraphic4-2012-11-30-14-53.png

3. Removing “Build path specifies execution environment J2SE-1.4” error

You may see “Build path specifies execution environment J2SE-1.4.” error in Mac OS X, it’s because some of the projects use JDK1.4, but the setup in the Mac is wrong.

http://stackoverflow.com/questions/13652032/build-path-specifies-execution-environment-j2se-1-4-error-in-eclipse

ScreenShot2012-11-30at1.35.53PM-2012-11-30-14-53.png

ScreenShot2012-11-30at2.32.59PM-2012-11-30-14-53.png

In eclipse Preference, you need to add Compatible JREs.

ScreenShot2012-11-30at12.46.32PM-2012-11-30-14-53.png

Check if you have Java SE correctly installed.

ScreenShot2012-11-30at1.39.46PM-2012-11-30-14-53.png

Then find all the projects with the “Build path specifies execution environment J2SE-1.4.” error.

PastedGraphic3-2012-11-30-14-53.png

Open the “Configure File Path”.

PastedGraphic2-2012-11-30-14-53.png

Replace the JRE System Library

ScreenShot2012-11-30at2.07.19PM-2012-11-30-14-53.png

with the one with you just setup.

ScreenShot2012-11-30at2.32.20PM-2012-11-30-14-53.png

Install Execution Environment Descriptor

http://stackoverflow.com/questions/13655635/installing-environment-descriptions-in-eclipse/13663453#13663453

Tuesday, October 30, 2012

simple make example

  • You can use variable by assigning it, and use it with $(), it can be anything, you can even think of it as a macro.
  • You can use $@ to replace the target. @ is a good name to represent the goal(target).
  • $+ means all prerequisites with space separated when multiple is given.
  • %.o:%.c shows the relationship based on extension name. Don't forget it uses % not *.
# 1
# Defining the compiler:
CC=gcc

# Defining the object files:
objects = main.o example.o

# 2
# The default rule - compiling our main program:
all:	sample
		echo all: make complete

# 3
sample: $(objects)
	# If we get here, all the dependencies are now built.
	# Link it:
	$(CC) -o $@ $+

# 4
# Tell make how to build .o files from .c files:
%.o:%.c
	$(CC) -c $+
	
# 5
#Now make sure that make rebuilds files if included headers change:
main.o: main.h defs.h
example.o: example.h defs.h
http://linuxdevcenter.com/pub/a/linux/2002/01/31/make_intro.html?page=2

phony target in make

When you execute make clean, you are using phony target. phony target is a target that doesn't have the dependencies, but only the actions.
# Naming our phony targets
.PHONY: clean install

# Removing the executable and the object files
clean: 
		rm sample main.o example.o
		echo clean: make complete

# Installing the final product
install:
		cp sample /usr/local
		echo install: make complete