Commit d2bf9a84 authored by Alejandro Mery's avatar Alejandro Mery
Browse files

tools: Move fexc into tools/


Signed-off-by: default avatarAlejandro Mery <amery@geeks.cl>
parent 7055b92c
fexc
bin2fex
fex2bin
bootinfo
fel
pio
......
......@@ -21,7 +21,7 @@ CFLAGS = -g -O0 -Wall -Wextra
CFLAGS += -std=c99 -D_POSIX_C_SOURCE=200112L
CFLAGS += -Iinclude/
TOOLS = fexc bin2fex fex2bin bootinfo fel pio
TOOLS = bootinfo fel pio
TOOLS += nand-part
MISC_TOOLS = phoenix_info
......@@ -40,14 +40,6 @@ clean:
$(TOOLS): Makefile common.h
fex2bin bin2fex: fexc
ln -s $< $@
fexc: fexc.h script.h script.c \
script_uboot.h script_uboot.c \
script_bin.h script_bin.c \
script_fex.h script_fex.c
LIBUSB = libusb-1.0
LIBUSB_CFLAGS = `pkg-config --cflags $(LIBUSB)`
LIBUSB_LIBS = `pkg-config --libs $(LIBUSB)`
......
.PHONY: all clean
CC = gcc
AR = ar
srctree ?= ..
O ?= $(srctree)/out
OBJDIR := $(O)/tools
TOOLS := fexc fex2bin bin2fex
SRCS := fexc.c
INCLUDES = -I$(srctree)/include
CFLAGS = -O2
CFLAGS += -Wall -Wextra -std=c99 -D_POSIX_C_SOURCE=200112L
CFLAGS += $(INCLUDES)
DEPS := $(OBJDIR)/deps.mk
all: $(addprefix $(O)/,$(TOOLS))
echo $^
clean:
rm -vf $(DEPS)
# fexc
$(O)/fexc: $(OBJDIR)/fexc.o $(O)/libfex.a
$(CC) -o $@ $^ $(CFLAGS)
%.o:
mkdir -p $(@D)
$(CC) -c -o $@ $(filter %.c,$^) $(CFLAGS)
$(O)/fex2bin $(O)/bin2fex: $(O)/fexc
ln -svnf fexc $@
# dependencies
$(DEPS): Makefile
mkdir -p $(@D)
for x in $(SRCS); do \
$(CC) -MM -MT $(OBJDIR)/$${x%.c}.o $$x $(INCLUDES); \
done > $@~
mv $@~ $@
include $(DEPS)
......@@ -22,9 +22,9 @@
#include <stdint.h>
#include <stdio.h>
#include "script.h"
#include "script_bin.h"
#include "script_fex.h"
#include "script_uboot.h"
#include "libfex/script.h"
#include "libfex/script_bin.h"
#include "libfex/script_fex.h"
#include "libfex/script_uboot.h"
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment