Skip to content

Rework makefiles. Add proper dependency checking. #219

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 24, 2014

Conversation

dhylands
Copy link
Contributor

The biggest difference is that object files now go into directory inside build based on where they came from.

I updated unix, unix-cpy, stm, and teensy

py/mkenv.mk primarily sets up variables and only lists a single target called all
py/mkrules.mk primarily contains rules

@dhylands
Copy link
Contributor Author

And this change means that we need to use GNU make 3.81 or newer. Since 3.81 is about 8 years old, I don't think that this should cause any problems.

dpgeorge added a commit that referenced this pull request Jan 24, 2014
Rework makefiles. Add proper dependency checking.
@dpgeorge dpgeorge merged commit 58b8a62 into micropython:master Jan 24, 2014
@dpgeorge
Copy link
Member

Hmm, doesn't work for me. After make clean I get:

make: *** No rule to make target 'build/py', needed by 'build/py/qstrdefs.generated.h'.  Stop.

@dpgeorge
Copy link
Member

But, otherwise, really nice work! Thanks!

@dhylands
Copy link
Contributor Author

Hmm. So I just checked out the latest (I'm now at fcd4ae) and it seems to be working for me.

The rules to make the directories (build and build/py) are in py/mkrules.mk

OBJ_DIRS = $(sort $(dir $(OBJ)))
$(OBJ): | $(OBJ_DIRS)
$(OBJ_DIRS):
    mkdir -p $@

So adding

$(info OBJ = $(OBJ))
$(info OBJ_DIRS = $(OBJ_DIRS))

might shed some light. If not, then if you want to email the output the make V=1 -d and also make V=1 -p to dhylands at gmail dot com, then I can see whats up.

@dhylands
Copy link
Contributor Author

Oh - yeah the generated header had to be dealt with specially. This line in py.mk

$(PY_BUILD)/qstrdefs.generated.h: | $(PY_BUILD)

is supposed to get the directory created.

I'll probably need to look at your make -d and make -p output.

@dhylands
Copy link
Contributor Author

So if anybody else runs into any build issues that might be related to the dependency code, please run this command:

make -dp whatever-other-options-you-normally-use > make.log 2>&1

and email me the make.log file (dhylands at gmaile dot com).

Thanks

@Neon22
Copy link
Contributor

Neon22 commented Jan 25, 2014

I don't want to reopen but have you guys considered waf ?
http://code.google.com/p/waf/wiki/WafAndOtherBuildSystems

Might an end goal to be to create builds for various targets and make it easy to update efficiently when a header or any other file is touched appropriately.

Oh and hey its Python, BSD, can be included, small, fast, efficient, blah blha blah...

@pfalcon
Copy link
Contributor

pfalcon commented Jan 25, 2014

@Neon22: Yes, we did, see original issue: #115. The problem with alternative systems is that there're so many of them and everyone likes different one.

@dpgeorge
Copy link
Member

I'd rather stick to something bog standard (ie make). I don't want to introduce extra build dependencies if it can be helped. Maybe in the future using make gets out of hand and we need to switch to something else, but for now it'll do :)

@dhylands dhylands deleted the add-deps branch February 11, 2014 05:40
tannewt added a commit to tannewt/circuitpython that referenced this pull request Sep 1, 2017
This prevents the SERCOM from blipping the data line on each
transaction and therefore fixes micropython#219.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants