Changeset dfeb4e2 in mainline for uspace/Makefile.common


Ignore:
Timestamp:
2018-01-06T02:37:59Z (6 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
c9e09f2
Parents:
3d95c9d
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-02 18:06:21)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-06 02:37:59)
Message:

Integrate ports into the main tree as a submodule.

A stripped down version of hsct.sh is added to tools, and Makefiles
gain new targets that implement part of hsct's prior functionality.

This arrangement improves usability and maintainability of ports,
reduces the likelihood of ports being broken by mainline changes,
and partially solves the issue with build logic being duplicated
in multiple places.

It is newly possible to build individual ports using make ports-NAME,
and all ports using make ports-all. This also installs the outputs to
uspace/dist, so ideally, simple make ports-all && make would create
an image with all ports included. This currently doesn't work only
because some ports fail to build.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/Makefile.common

    r3d95c9d rdfeb4e2  
    174174endif
    175175
    176 COMMON_CFLAGS = $(INCLUDES_FLAGS) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \
    177         -ffreestanding -fno-builtin -nostdlib -nostdinc -fexec-charset=UTF-8 \
    178         -finput-charset=UTF-8 -D__$(ENDIANESS)__ -fno-common \
     176# Flags that are not necessary, and can be overriden, but are used by default.
     177DEFAULT_CFLAGS = \
     178        -O$(OPTIMIZATION) \
     179        -ffunction-sections \
     180        -pipe \
     181        -Wall \
     182        -Wextra \
     183        -Wno-unused-parameter \
     184        -Wmissing-prototypes \
     185        -Wwrite-strings \
     186        -Werror-implicit-function-declaration
     187
     188ifeq ($(CONFIG_DEBUG),y)
     189        DEFAULT_CFLAGS += -Werror
     190endif
     191
     192ifeq ($(COMPILER),clang)
     193        DEFAULT_CFLAGS += \
     194                -Wno-missing-field-initializers \
     195                -Wno-typedef-redefinition \
     196                -Wno-unused-command-line-argument
     197else
     198        DEFAULT_CFLAGS += \
     199                -Wno-clobbered
     200endif
     201
     202ifeq ($(CONFIG_LINE_DEBUG),y)
     203        DEFAULT_CFLAGS += -ggdb
     204endif
     205
     206# Flags that should always be used, even for third-party software.
     207COMMON_CFLAGS = \
     208        -ffreestanding \
     209        -fno-builtin \
     210        -nostdlib \
     211        -nostdinc \
     212        -D__$(ENDIANESS)__
     213
     214# Flags that are always used for HelenOS code, but not for third-party.
     215HELENOS_CFLAGS = \
     216        -std=gnu99 \
     217        $(INCLUDES_FLAGS) \
     218        -imacros $(CONFIG_HEADER) \
     219        -fexec-charset=UTF-8 \
     220        -finput-charset=UTF-8 \
     221        -fno-common \
    179222        -fdebug-prefix-map=$(realpath $(ROOT_PATH))=.
    180223
    181 GCC_CFLAGS = -ffunction-sections -Wall -Wextra -Wno-clobbered \
    182         -Wno-unused-parameter -Wmissing-prototypes -std=gnu99 \
    183         -Werror-implicit-function-declaration \
    184         -Wwrite-strings -pipe
    185 
    186 # -Wno-missing-prototypes is there because it warns about main().
    187 # This should be fixed elsewhere.
    188 CLANG_CFLAGS = -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-typedef-redefinition \
    189         -Wno-missing-prototypes -Wno-unused-command-line-argument \
    190         -std=gnu99 -Werror-implicit-function-declaration -Wwrite-strings \
    191         -pipe -fno-stack-protector -fno-PIC
    192 
    193 ifeq ($(CONFIG_DEBUG),y)
    194         COMMON_CFLAGS += -Werror
    195 endif
    196 
    197 ifeq ($(CONFIG_LINE_DEBUG),y)
    198         GCC_CFLAGS += -ggdb
    199         CLANG_CFLAGS += -g
    200 endif
     224# TODO: Use a different name.
     225# CFLAGS variable is traditionally used for overridable flags.
     226CFLAGS = $(COMMON_CFLAGS) $(HELENOS_CFLAGS) $(DEFAULT_CFLAGS)
    201227
    202228## Setup platform configuration
     
    214240else
    215241        CC_JOB = $(CC) $< -o $@
    216 endif
    217 
    218 ifeq ($(COMPILER),clang)
    219         CFLAGS += $(COMMON_CFLAGS) $(CLANG_CFLAGS)
    220 else
    221         CFLAGS += $(COMMON_CFLAGS) $(GCC_CFLAGS)
    222242endif
    223243
Note: See TracChangeset for help on using the changeset viewer.