Une lib de log simple d'utilisation nécéssitant gint.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

62 lines
1004 B

include Makefile.cfg
#! /usr/bin/make -f
# liblog Makefile
ifeq "$(MODEL)" ""
$(error "Cannot determine choosed model")
endif
ifeq "$(MODEL)" "fx"
modelflag := -DFX9860G
endif
ifeq "$(MODEL)" "cg"
modelflag := -DFXCG50
endif
cflags := -m3 -mb -ffreestanding -nostdlib -fstrict-volatile-bitfields -Wall \
-Wextra -Os -I . $(modelflag)
target ?= sh-elf
lib := liblog-$(MODEL).a
header := liblog.h
prefix := $(shell $(target)-gcc -print-search-dirs | grep install \
| sed 's/install: //')
ifeq "$(prefix)" ""
$(error "Cannot determine compiler install path")
endif
src := $(wildcard *.c)
obj := $(src:%=build-$(MODEL)/%.o)
# Rules
all: $(lib)
$(lib): $(obj)
$(target)-ar rcs $@ $^
build-$(MODEL)/%.c.o: %.c | build-$(MODEL)/
$(target)-gcc -c $< -o $@ $(cflags)
# Misc rules
clean:
@ rm -rf build-fx
@ rm -rf build-cg
distclean: clean
@ rm -f $(lib)
%/:
mkdir -p $@
.PRECIOUS: %/
# Install
install:
cp $(lib) $(prefix)
cp $(header) $(prefix)/include