mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-17 18:41:22 +00:00
Makefile: Add simple compilation rule for C
We only use C as an interface (e.g. to POSIX). Thus, we keep the rules simple and don't do any dependency tracking. Change-Id: I62b4b4e4d3ae83d5e1f1811f783b559b225746e6 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/18778 Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
committed by
Stefan Reinauer
parent
5f82d1ab97
commit
e86fff93bd
22
Makefile
22
Makefile
@@ -28,13 +28,15 @@ include $(libhw-dir)/Makefile.proof
|
||||
CC = $(CROSS_COMPILE)gcc
|
||||
GNATBIND = $(CROSS_COMPILE)gnatbind
|
||||
|
||||
CFLAGS += -Wuninitialized -Wall -Werror
|
||||
CFLAGS += -pipe -g
|
||||
CFLAGS += -Wstrict-aliasing -Wshadow
|
||||
CFLAGS += -fno-common -fomit-frame-pointer
|
||||
CFLAGS += -ffunction-sections -fdata-sections
|
||||
|
||||
ADAFLAGS += -gnatA -gnatec=$(libhw-dir)/gnat.adc
|
||||
ADAFLAGS += -gnatg -gnatp
|
||||
ADAFLAGS += -Wuninitialized -Wall -Werror
|
||||
ADAFLAGS += -pipe -g
|
||||
ADAFLAGS += -Wstrict-aliasing -Wshadow
|
||||
ADAFLAGS += -fno-common -fomit-frame-pointer
|
||||
ADAFLAGS += -ffunction-sections -fdata-sections
|
||||
ADAFLAGS += $(CFLAGS)
|
||||
# Ada warning options:
|
||||
#
|
||||
# a Activate most optional warnings.
|
||||
@@ -97,9 +99,10 @@ $(foreach dep,$($(name)-deplibs), \
|
||||
src-to-obj = \
|
||||
$(addprefix $(obj)/,\
|
||||
$(patsubst $(obj)/%,%, \
|
||||
$(patsubst %.c,%.o,\
|
||||
$(patsubst %.ads,%.o,\
|
||||
$(patsubst %.adb,%.o,\
|
||||
$(2)))))
|
||||
$(2))))))
|
||||
|
||||
# Converts one or more source file paths to the corresponding build/ paths
|
||||
# of their Ada library information (.ali) files.
|
||||
@@ -194,7 +197,7 @@ add_ada_deps = \
|
||||
$(call src-to-obj,,$(1)): $(1) \
|
||||
$(call create_ada_deps,$(call src-to-ali,,$(1)))
|
||||
|
||||
# Writes a compilation rule for a source type
|
||||
# Writes a compilation rule for Ada sources
|
||||
# $1 source type (ads, adb)
|
||||
# $2 source files (including the colon)
|
||||
# $3 obj path prefix (including the trailing slash)
|
||||
@@ -235,6 +238,11 @@ $(obj)/b__lib$(name).adb: $($(name)-alis)
|
||||
$(eval $(call add_ada_rule,adb,$(obj)/b__lib$(name).o:,))
|
||||
$(name)-objs += $(obj)/b__lib$(name).o
|
||||
|
||||
# Compilation rule for C sources
|
||||
$(call src-to-obj,,$(filter %.c,$($(name)-srcs))): $(obj)/%.o: %.c
|
||||
@printf " COMPILE $(subst $(obj)/,,$@)\n"
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
$(shell mkdir -p $(alldirs))
|
||||
|
||||
$(name)-install-srcs = $(sort \
|
||||
|
||||
Reference in New Issue
Block a user