sunxi-tools/Makefile

44 lines
797 B
Makefile
Raw Normal View History

2012-05-02 09:35:52 +02:00
CC = gcc
CFLAGS = -g -O0 -Wall -Wextra
CFLAGS += -std=c99 -D_POSIX_C_SOURCE=200112L
2012-05-02 09:35:52 +02:00
TOOLS = fexc bin2fex fex2bin bootinfo fel
2012-05-02 09:35:52 +02:00
MISC_TOOLS = phoenix_info
2012-05-02 09:35:52 +02:00
.PHONY: all clean
all: $(TOOLS)
misc: $(MISC_TOOLS)
2012-05-02 09:35:52 +02:00
clean:
@rm -vf $(TOOLS) $(MISC_TOOLS)
2012-05-02 09:35:52 +02:00
2012-05-10 09:33:41 +02:00
$(TOOLS): Makefile common.h
fex2bin bin2fex: fexc
ln -s $< $@
fexc: fexc.h script.h script.c \
script_bin.h script_bin.c \
script_fex.h script_fex.c
2012-05-11 09:22:47 +02:00
bootinfo: bootinfo.c
LIBUSB = libusb-1.0
LIBUSB_CFLAGS = `pkg-config --cflags $(LIBUSB)`
LIBUSB_LIBS = `pkg-config --libs $(LIBUSB)`
fel: fel.c
$(CC) $(CFLAGS) $(LIBUSB_CFLAGS) $(LDFLAGS) -o $@ $(filter %.c,$^) $(LIBS) $(LIBUSB_LIBS)
%: %.c
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(filter %.c,$^) $(LIBS)
2012-05-02 09:35:52 +02:00
.gitignore: Makefile
@for x in $(TOOLS) '*.o' '*.swp'; do \
echo $$x; \
done > $@