OpenLibm/Makefile

30 lines
802 B
Makefile
Raw Normal View History

2012-05-25 22:24:37 +02:00
OPENLIBM_HOME=$(abspath .)
2011-12-31 08:18:43 +01:00
include ./Make.inc
2012-05-25 22:24:37 +02:00
SUBDIRS = src ld80 $(ARCH) bsdsrc
define INC_template
TEST=test
override CUR_SRCS = $(1)_SRCS
include $(1)/Make.files
SRCS += $$(addprefix $(1)/,$$($(1)_SRCS))
endef
DIR=test
$(foreach dir,$(SUBDIRS),$(eval $(call INC_template,$(dir))))
DUPLICATE_NAMES = $(filter $(patsubst %.S,%,$($(ARCH)_SRCS)),$(patsubst %.c,%,$(src_SRCS)))
DUPLICATE_SRCS = $(addsuffix .c,$(DUPLICATE_NAMES))
OBJS = $(patsubst %.S,%.S.o,\
$(patsubst %.c,%.c.o,$(filter-out $(addprefix src/,$(DUPLICATE_SRCS)),$(SRCS))))
all: libopenlibm.a libopenlibm.$(SHLIB_EXT)
libopenlibm.a: $(OBJS)
$(QUIET_LINK)ar -rcs libopenlibm.a $(OBJS)
libopenlibm.$(SHLIB_EXT): $(OBJS)
2012-05-26 03:25:13 +02:00
$(QUIET_LINK)$(CC) -shared $(OBJS) -o libopenlibm.$(SHLIB_EXT)
2011-12-31 08:18:43 +01:00
cleanall:
2012-05-25 22:24:37 +02:00
rm -f $(OBJS) *.a *.$(SHLIB_EXT)