Commit 7055b92c authored by Alejandro Mery's avatar Alejandro Mery
Browse files

libfex: move script*.c into lib/libfex and set to create a .a


Signed-off-by: default avatarAlejandro Mery <amery@geeks.cl>
parent 9ebe16b2
...@@ -8,3 +8,4 @@ nand-part ...@@ -8,3 +8,4 @@ nand-part
meminfo meminfo
*.o *.o
*.swp *.swp
out
CC = gcc
AR = ar
srctree ?= ../..
O ?= $(srctree)/out
OBJDIR := $(O)/libfex
LIBFEX := $(O)/libfex.a
SRCS := $(wildcard *.c)
OBJS := $(patsubst %.c,$(OBJDIR)/%.o,$(SRCS))
INCLUDES = -I$(srctree)/include
CFLAGS = -O2
CFLAGS += -Wall -Wextra -std=c99 -D_POSIX_C_SOURCE=200112L
CFLAGS += $(INCLUDES)
DEPS := $(OBJDIR)/deps.mk
# libfex.a
$(LIBFEX): $(OBJS)
@mkdir -vp $(@D)
$(AR) rcs $@ $^
# out/foo.o: foo.c
$(OBJS): SRC=$(patsubst $(OBJDIR)/%.o,%.c,$@)
$(OBJS):
@mkdir -vp $(@D)
$(CC) $(CFLAGS) -c -o $@ $(SRC)
# 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,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "script.h" #include "libfex/script.h"
/* /*
*/ */
......
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "script.h" #include "libfex/script.h"
#include "script_bin.h" #include "libfex/script_bin.h"
#define pr_info(...) errf("fexc-bin: " __VA_ARGS__) #define pr_info(...) errf("fexc-bin: " __VA_ARGS__)
#define pr_err(...) errf("E: fexc-bin: " __VA_ARGS__) #define pr_err(...) errf("E: fexc-bin: " __VA_ARGS__)
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "script.h" #include "libfex/script.h"
#include "script_fex.h" #include "libfex/script_fex.h"
#define MAX_LINE 255 #define MAX_LINE 255
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "script.h" #include "libfex/script.h"
#include "script_uboot.h" #include "libfex/script_uboot.h"
#define pr_info(...) errf("fexc-uboot: " __VA_ARGS__) #define pr_info(...) errf("fexc-uboot: " __VA_ARGS__)
#define pr_err(...) errf("E: fexc-uboot: " __VA_ARGS__) #define pr_err(...) errf("E: fexc-uboot: " __VA_ARGS__)
......
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