1 # Makefile - Build the bundled tasks 2 # 3 # Copyright (C) 2015, 2016 Paul Boddie <paul@boddie.org.uk> 4 # Copyright (C) Xiangfu Liu <xiangfu@sharism.cc> 5 # 6 # This program is free software: you can redistribute it and/or modify 7 # it under the terms of the GNU General Public License as published by 8 # the Free Software Foundation, either version 3 of the License, or 9 # (at your option) any later version. 10 # 11 # This program is distributed in the hope that it will be useful, 12 # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 # GNU General Public License for more details. 15 # 16 # You should have received a copy of the GNU General Public License 17 # along with this program. If not, see <http://www.gnu.org/licenses/>. 18 19 ARCH = mipsel-linux-gnu 20 CC = $(ARCH)-gcc 21 22 # NOTE: -O2 is actually needed to prevent memcpy references, whereas probably 23 # NOTE: one of the -f{freestanding, no-hosted, no-builtin} options should work. 24 # NOTE: See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56888 25 26 CFLAGS = -O2 -Wall \ 27 -fno-unit-at-a-time -fno-zero-initialized-in-bss \ 28 -ffreestanding -fno-hosted -fno-builtin -fPIC \ 29 -march=mips32 \ 30 -I../../include -I.. 31 LDFLAGS = -nostdlib -EL 32 33 # Configure task objects. 34 35 DEFS = 36 SRC = $(wildcard *.c) 37 OBJ = $(SRC:.c=.o) 38 39 .PHONY: all clean distclean 40 41 all: $(OBJ) 42 43 clean: 44 rm -f $(OBJ) 45 46 distclean: clean 47 echo "Nothing else to clean." 48 49 .c.o: 50 $(CC) -c $(CFLAGS) $(DEFS) $< -o $@ 51 52 .S.o: 53 $(CC) -c $(CFLAGS) $(DEFS) $< -o $@