mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
45 lines
1.1 KiB
Makefile
45 lines
1.1 KiB
Makefile
#
|
|
# $Id: libc.gmk,v 1.9 2010-10-20 13:50:17 obarthel Exp $
|
|
#
|
|
# vim:ts=8 ft=make:
|
|
#
|
|
# -*- mode: makefile; -*-
|
|
|
|
##############################################################################
|
|
|
|
include libc.obj.gmk
|
|
C_LIB := $(sort $(C_LIB_COMMON) $(C_LIB_OS4))
|
|
|
|
##############################################################################
|
|
|
|
define libc_rule
|
|
|
|
LIBS += lib/$(1).a lib.threadsafe/$(1).a
|
|
|
|
# Dependencies to rebuild if the library version changes
|
|
obj/$(1)/c.lib_rev.o : c.lib_rev.c c.lib_rev.h
|
|
obj.threadsafe/$(1)/c.lib_rev.o : c.lib_rev.c c.lib_rev.h
|
|
|
|
obj/$(1)/%.o : CFLAGS += $(2)
|
|
obj/$(1)/%.o : %.c
|
|
@$$(COMPILE)
|
|
|
|
obj.threadsafe/$(1)/%.o : CFLAGS += $(THREADSAFE) $(2)
|
|
obj.threadsafe/$(1)/%.o : %.c
|
|
@$$(COMPILE)
|
|
|
|
lib/$(1).a : $$(addprefix obj/$(1)/,$$(C_LIB))
|
|
@$$(MAKELIB)
|
|
|
|
lib.threadsafe/$(1).a : $$(addprefix obj.threadsafe/$(1)/,$$(C_LIB))
|
|
@$$(MAKELIB)
|
|
|
|
endef
|
|
|
|
##############################################################################
|
|
|
|
$(eval $(call libc_rule,libc,$(LARGEDATA)))
|
|
$(eval $(call libc_rule,soft-float/libc,$(SOFTFLOAT)))
|
|
$(eval $(call libc_rule,small-data/libc,$(SMALLDATA)))
|
|
$(eval $(call libc_rule,baserel/libc,$(BASEREL)))
|