Commit 3e463624 authored by Alessandro Rubini's avatar Alessandro Rubini

minic and vic: cleanup Makefiles

This commit cleans up the Makefiles, removing the "build.sh"
scripts and adding EXTRA_CFLAGS to include wr_vic.h from
wr_minic directory.  This works, but the next commit
works better.
parent fb59f3f4
include ../../Makedefs
all:
cd wr_vic && ./build.sh && cd ..
cd wr_minic && ./build.sh && cd ..
cp wr_minic/*.ko wr_vic/*.ko bin
clean:
cd wr_vic && ./build.sh clean && cd ..
cd wr_minic && ./build.sh clean && cd ..
export WR_MODULES_DIR = $(shell /bin/pwd)
deploy: all
mkdir -p $(WR_INSTALL_ROOT)/lib
mkdir -p $(WR_INSTALL_ROOT)/lib/modules
cp bin/*.ko $(WR_INSTALL_ROOT)/lib/modules
DIRS = wr_vic wr_minic
# We may "LINUX ?= /usr/src/linux-wrswitch", but it's better to leave it empty
all modules clean:
for n in $(DIRS); do \
$(MAKE) -C $$n $@ || exit 1; \
done
run: all
scp bin/*.ko root@$(T):/wr/lib/modules
\ No newline at end of file
all modules: check
check:
@if [ "x$(LINUX)" = "x" ]; then \
echo "Please set \$$LINUX in the environment or cmdline" >& 2;\
exit 1; \
fi
# One extra rule, that was used by some previous users
MAKEDEFS = ../../Makedefs
ifeq ($(wildcard $(MAKEDEFS)),$(MAKEDEFS))
include $(MAKEDEFS)
deploy: all
mkdir -p $(WR_INSTALL_ROOT)/lib/modules
cp $$(find . -name '*.ko') $(WR_INSTALL_ROOT)/lib/modules
endif
\ No newline at end of file
obj-m := wr_minic.o
KDIR := ../../../kernel
PWD := $(shell pwd)
EXTRA_CFLAGS := -I$(SUBDIRS)/../wr_vic
MAKE = make
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
\ No newline at end of file
# This is needed to include wr_vic.h
WR_MODULES_DIR ?= $(shell /bin/pwd)/..
EXTRA_CFLAGS = -I$(WR_MODULES_DIR)/wr_vic
export ARCH ?= arm
export CROSS_COMPILE ?= $(CROSS_COMPILE_ARM)
all modules:
$(MAKE) CONFIG_DEBUG_SECTION_MISMATCH=y \
-C $(LINUX) SUBDIRS=$(shell /bin/pwd) modules
# We might "$(MAKE) -C $(LINUX)" but "make clean" with no LINUX defined
# is sometimes useful to have
clean:
rm -f *.mod.c *.o *.ko .*cmd Module.symvers modules.order
rm -rf .tmp_versions
#!/bin/sh
. ../../../settings
make CONFIG_DEBUG_SECTION_MISMATCH=y ARCH=arm CROSS_COMPILE=$CROSS_COMPILE_ARM -C ../../../kernel SUBDIRS=`pwd` modules $1
#cp wr_minic.ko ../bin
\ No newline at end of file
obj-m := wr_vic.o
KDIR := ../../../kernel
PWD := $(shell pwd)
MAKE = make
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
export ARCH ?= arm
export CROSS_COMPILE ?= $(CROSS_COMPILE_ARM)
all modules:
$(MAKE) CONFIG_DEBUG_SECTION_MISMATCH=y \
-C $(LINUX) SUBDIRS=$(shell /bin/pwd) modules
# We might "$(MAKE) -C $(LINUX)" but "make clean" with no LINUX defined
# is sometimes useful to have
clean:
rm -f *.mod.c *.o *.ko .*cmd Module.symvers modules.order
rm -rf .tmp_versions
#!/bin/sh
. ../../../settings
make CONFIG_DEBUG_SECTION_MISMATCH=y ARCH=arm CROSS_COMPILE=$CROSS_COMPILE_ARM -C ../../../kernel SUBDIRS=`pwd` modules $1
#cp wr_vic.ko ../bin
\ No newline at end of file
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