mirror of
https://git.planet-casio.com/Lephenixnoir/libprof.git
synced 2024-12-26 19:43:41 +01:00
build system
This commit is contained in:
commit
d8883da3c0
3 changed files with 49 additions and 0 deletions
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Build files
|
||||
build/
|
||||
libprof.a
|
44
Makefile
Normal file
44
Makefile
Normal file
|
@ -0,0 +1,44 @@
|
|||
#! /usr/bin/make -f
|
||||
# libprof Makefile
|
||||
|
||||
cflags := -m3 -mb -ffreestanding -nostdlib -fstrict-volatile-bitfields -Wall \
|
||||
-Wextra -Os -std=c11
|
||||
target := sh3eb-elf
|
||||
lib := libprof.a
|
||||
|
||||
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/%.o)
|
||||
|
||||
# Rules
|
||||
|
||||
all: $(lib)
|
||||
|
||||
$(lib): $(obj)
|
||||
ar rcs $@ $^
|
||||
|
||||
build/%.c.o: %.c | build/
|
||||
$(target)-gcc -c $< -o $@ $(cflags)
|
||||
|
||||
# Misc rules
|
||||
|
||||
clean:
|
||||
@ rm -rf build
|
||||
distclean: clean
|
||||
@ rm -f $(lib)
|
||||
|
||||
%/:
|
||||
mkdir -p $@
|
||||
|
||||
.PRECIOUS: %/
|
||||
|
||||
# Install
|
||||
|
||||
install:
|
||||
cp $(lib) $(prefix)
|
2
libprof.c
Normal file
2
libprof.c
Normal file
|
@ -0,0 +1,2 @@
|
|||
#include <gint/timer.h>
|
||||
#include <gint/mpu/tmu.h>
|
Loading…
Reference in a new issue