Skip to content

Commit

Permalink
all: Make netutils.h available to all ports by default.
Browse files Browse the repository at this point in the history
Generally, ports should inherit INC from py.mk, append to it, not
overwrite it. TODO: Likely should do the same for other vars too.
  • Loading branch information
Paul Sokolovsky committed Oct 19, 2015
1 parent 8ee153f commit e0f5df5
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bare-arm/Makefile
Expand Up @@ -8,7 +8,7 @@ include ../py/py.mk

CROSS_COMPILE = arm-none-eabi-

INC = -I.
INC += -I.
INC += -I..
INC += -I$(BUILD)

Expand Down
2 changes: 1 addition & 1 deletion esp8266/Makefile
Expand Up @@ -14,7 +14,7 @@ BAUD = 115200
CROSS_COMPILE = xtensa-lx106-elf-
ESP_SDK = $(shell $(CC) -print-sysroot)/usr

INC = -I.
INC += -I.
INC += -I..
INC += -I../stmhal
INC += -I../lib/mp-readline
Expand Down
2 changes: 1 addition & 1 deletion minimal/Makefile
Expand Up @@ -12,7 +12,7 @@ ifeq ($(CROSS), 1)
CROSS_COMPILE = arm-none-eabi-
endif

INC = -I.
INC += -I.
INC += -I..
INC += -I../lib/mp-readline
INC += -I../stmhal
Expand Down
2 changes: 1 addition & 1 deletion pic16bit/Makefile
Expand Up @@ -12,7 +12,7 @@ CROSS_COMPILE = $(XC16)/bin/xc16-
PARTFAMILY = dsPIC33F
PART = 33FJ256GP506

INC = -I.
INC += -I.
INC += -I..
INC += -I../lib/mp-readline
INC += -I../stmhal
Expand Down
2 changes: 2 additions & 0 deletions py/py.mk
Expand Up @@ -10,6 +10,8 @@ PY_QSTR_DEFS = $(PY_SRC)/qstrdefs.h
# some code is performance bottleneck and compiled with other optimization options
CSUPEROPT = -O3

INC += -I../lib/netutils

ifeq ($(MICROPY_PY_USSL),1)
CFLAGS_MOD += -DMICROPY_PY_USSL=1 -I../lib/axtls/ssl -I../lib/axtls/crypto -I../lib/axtls/config
LDFLAGS_MOD += -L../lib/axtls/_stage -laxtls
Expand Down
2 changes: 1 addition & 1 deletion qemu-arm/Makefile
Expand Up @@ -9,7 +9,7 @@ include ../py/py.mk

CROSS_COMPILE = arm-none-eabi-

INC = -I.
INC += -I.
INC += -I..
INC += -I$(BUILD)
INC += -I../tools/tinytest/
Expand Down
2 changes: 1 addition & 1 deletion stmhal/Makefile
Expand Up @@ -32,7 +32,7 @@ DEVICE=0483:df11

CROSS_COMPILE = arm-none-eabi-

INC = -I.
INC += -I.
INC += -I..
INC += -I$(BUILD)
INC += -I$(CMSIS_DIR)/inc
Expand Down
2 changes: 1 addition & 1 deletion teensy/Makefile
Expand Up @@ -29,7 +29,7 @@ endif
CFLAGS_TEENSY = -DF_CPU=96000000 -DUSB_SERIAL -D__MK20DX256__
CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -mcpu=cortex-m4 -msoft-float -mfloat-abi=soft -fsingle-precision-constant -Wdouble-promotion $(CFLAGS_TEENSY)

INC = -I.
INC += -I.
INC += -I..
INC += -I../stmhal
INC += -I../lib/mp-readline
Expand Down
2 changes: 1 addition & 1 deletion unix/Makefile
Expand Up @@ -13,7 +13,7 @@ UNAME_S := $(shell uname -s)
# include py core make definitions
include ../py/py.mk

INC = -I.
INC += -I.
INC += -I..
INC += -I$(BUILD)

Expand Down
2 changes: 1 addition & 1 deletion windows/Makefile
Expand Up @@ -10,7 +10,7 @@ QSTR_DEFS = ../unix/qstrdefsport.h
# include py core make definitions
include ../py/py.mk

INC = -I.
INC += -I.
INC += -I..
INC += -I$(BUILD)

Expand Down

3 comments on commit e0f5df5

@pfalcon
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dpgeorge , @dhylands : FYI, came out as prerequisite for generalizing #1517

INC += -I../lib/netutils

This keeps current #include <netutils.h> working, but maybe we want to have -I../lib to cover any lib module, or maybe even -I.. to have #include <lib/netutils/netutils.h>, kinda for consistency with #include <py/...>. (But note that we still will need custom includes in some cases, e.g. libffi, libaxtls - which have their own structure and build system).

@dhylands
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I kind of like <lib/netutils/netutils.h>

I think it makes it much clearer about where the header file is actually located, and as you suggested it is conistent with py/....

It also looks like we're already doing that in stmhal for things like "lib/fatfs/ff.h"

I agree that we may still need to add -I statements for libraries since they may well have their own include hierarchy needs. Files that we provide should still use the "lib/netutils/netutils.h" syntax and files that come from the external module will use whatever convention they've decided.

@dpgeorge
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, definitely we should move to #include "lib/netutils/netutils.h" etc. Much better that way, and facilitates pasting uPy into another code base.

Please sign in to comment.