aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--external/pflash/Makefile2
-rw-r--r--external/pflash/rules.mk16
-rw-r--r--external/shared/Makefile23
3 files changed, 20 insertions, 21 deletions
diff --git a/external/pflash/Makefile b/external/pflash/Makefile
index 3a4c563..4c9b08b 100644
--- a/external/pflash/Makefile
+++ b/external/pflash/Makefile
@@ -1,5 +1,5 @@
include rules.mk
-GET_ARCH = ../../external/common/get_arch.sh
+GET_ARCH := ../../external/common/get_arch.sh
include ../../external/common/rules.mk
all: links arch_links $(EXE)
diff --git a/external/pflash/rules.mk b/external/pflash/rules.mk
index df814fe..6be9b67 100644
--- a/external/pflash/rules.mk
+++ b/external/pflash/rules.mk
@@ -1,11 +1,8 @@
.DEFAULT_GOAL := all
override CFLAGS += -O2 -Wall -I.
-PFLASH_OBJS = pflash.o progress.o version.o common-arch_flash.o
-LIBFLASH_FILES := libflash.c libffs.c ecc.c blocklevel.c file.c
-LIBFLASH_OBJS := $(addprefix libflash-, $(LIBFLASH_FILES:.c=.o))
-LIBFLASH_SRC := $(addprefix libflash/,$(LIBFLASH_FILES))
-OBJS = $(PFLASH_OBJS) $(LIBFLASH_OBJS)
+PFLASH_OBJS := pflash.o progress.o version.o common-arch_flash.o
+OBJS := $(PFLASH_OBJS) $(LIBFLASH_OBJS)
EXE = pflash
sbindir?=/usr/sbin
@@ -14,8 +11,8 @@ LINKAGE?=static
ifeq ($(LINKAGE),dynamic)
include ../shared/rules.mk
-SHARED=../shared/$(SHARED_NAME)
-OBJS=$(PFLASH_OBJS) $(SHARED)
+SHARED := ../shared/$(SHARED_NAME)
+OBJS := $(PFLASH_OBJS) $(SHARED)
INSTALLDEPS+=install-shared
install-shared:
@@ -35,11 +32,6 @@ version.c: .version
%.o : %.c
$(Q_CC)$(CC) $(CFLAGS) -c $< -o $@
-$(LIBFLASH_SRC): | links
-
-$(LIBFLASH_OBJS): libflash-%.o : libflash/%.c
- $(Q_CC)$(CC) $(CFLAGS) -c $< -o $@
-
$(EXE): $(OBJS)
$(Q_CC)$(CC) $(CFLAGS) $^ -lrt -o $@
diff --git a/external/shared/Makefile b/external/shared/Makefile
index c643666..e0b3ff3 100644
--- a/external/shared/Makefile
+++ b/external/shared/Makefile
@@ -1,23 +1,30 @@
.DEFAULT_GOAL := all
-GET_ARCH = ../../external/common/get_arch.sh
+GET_ARCH := ../../external/common/get_arch.sh
include ../../external/common/rules.mk
include rules.mk
PREFIX ?= /usr/local/
-LIBDIR = $(PREFIX)/lib
-INCDIR = $(PREFIX)/include/libflash
+LIBDIR := $(PREFIX)/lib
+INCDIR := $(PREFIX)/include/libflash
ifneq ($(ARCH), ARCH_ARM)
CFLAGS += -m64
endif
CFLAGS += -Werror -Wall -g2 -ggdb -I. -fPIC
-LIBFLASH_OBJS = libflash-file.o libflash-libflash.o libflash-libffs.o libflash-ecc.o libflash-blocklevel.o
-ARCHFLASH_OBJS = common-arch_flash.o
-OBJS = $(LIBFLASH_OBJS) $(ARCHFLASH_OBJS)
+LIBFLASH_OBJS := libflash-file.o libflash-libflash.o libflash-libffs.o \
+ libflash-ecc.o libflash-blocklevel.o
+ARCHFLASH_OBJS := common-arch_flash.o
+OBJS := $(LIBFLASH_OBJS) $(ARCHFLASH_OBJS)
-LIBFLASH_H = libflash/file.h libflash/libflash.h libflash/libffs.h libflash/ffs.h libflash/ecc.h libflash/blocklevel.h libflash/errors.h
-ARCHFLASH_H = common/arch_flash.h
+LIBFLASH_H := libflash/file.h libflash/libflash.h libflash/libffs.h \
+ libflash/ffs.h libflash/ecc.h libflash/blocklevel.h libflash/errors.h
+ARCHFLASH_H := common/arch_flash.h
+
+LIBFLASH_FILES := libflash.c libffs.c ecc.c blocklevel.c file.c
+LIBFLASH_SRC := $(addprefix libflash/,$(LIBFLASH_FILES))
+
+$(LIBFLASH_SRC): | links
$(LIBFLASH_OBJS) : libflash-%.o : libflash/%.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@