Commit eaf8c7dc authored by Federico Vaga's avatar Federico Vaga

Merge branch 'makefile-fixes'

parents 10d52ba6 f17180a2
......@@ -5,21 +5,27 @@ SPEC_SW := $(shell scripts/check-submodule spec-sw $(SPEC_SW))
DESTDIR ?= /usr/local
.PHONY: all clean modules install modules_install default
.PHONY: gitmodules prereq prereq_install prereq_install_warn
.PHONY: gitmodules prereq prereq_install prereq_install_warn prereq_clean
DIRS = kernel lib tools
all clean modules install modules_install:
all clean modules install modules_install: gitmodules
@if echo $@ | grep -q install; then $(MAKE) prereq_install_warn; fi
for d in $(DIRS); do $(MAKE) ZIO=$(ZIO) FMC_BUS=$(FMC_BUS) -C $$d $@ || exit 1; done
all modules: prereq
clean_all: clean prereq_clean
# a hack, to prevent compiling wr-nic.ko, which won't work on older kernels
CONFIG_WR_NIC=n
export CONFIG_WR_NIC
#### The following targets are used to manage prerequisite repositories
gitmodules:
@test -d fmc-bus/doc || echo "Checking out submodules"
@test -d fmc-bus/doc || git submodule update --init
@git submodule update
# The user can override, using environment variables, all these three:
SUBMOD = $(FMC_BUS) $(ZIO) $(SPEC_SW)
......@@ -35,4 +41,7 @@ prereq_install:
for d in $(SUBMOD); do $(MAKE) -C $$d modules_install || exit 1; done
touch .prereq_installed
prereq_clean:
for d in $(SUBMOD); do $(MAKE) -C $$d clean || exit 1; done
include scripts/gateware.mk
fmc-bus @ a650c838
Subproject commit 05fabf80f2f539c591336266ece33cf530eae4ad
Subproject commit a650c8382e197bc403adbb1c29106cedaf4f8b4a
LINUX ?= /lib/modules/$(shell uname -r)/build
ZIO ?= $(M)/../zio
FMC_BUS ?= $(M)/../fmc-bus
ZIO ?= $(src)/../zio
FMC_BUS ?= $(src)/../fmc-bus
KBUILD_EXTRA_SYMBOLS := \
$(ZIO)/Module.symvers \
......@@ -14,7 +14,7 @@ ccflags-y = \
-I$(FMC_BUS)/kernel/include \
-I$(FMC_BUS)/kernel/include/linux \
-I$(FMC_BUS) \
-I$M
-I$(src)
ccflags-y += -DGIT_VERSION=\"$(GIT_VERSION)\"
#ccflags-y += -DDEBUG
......
......@@ -8,7 +8,7 @@ LOBJ += fdelay-time.o
LOBJ += fdelay-tdc.o
LOBJ += fdelay-output.o
CFLAGS = -Wall -ggdb -O2 -I../kernel -I$(ZIO)/include
CFLAGS = -Wall -ggdb -O2 -I../kernel -I$(ZIO)/include $(EXTRACFLAGS)
LDFLAGS = -L. -lfdelay
DESTDIR ?= /usr/local
......
spec-sw @ bd72a44c
Subproject commit c8c33161e210b10bc8eb74d0bda8766a60d58992
Subproject commit bd72a44cca240fdd58f63fd4ec0e73ad0bea2b1a
......@@ -4,35 +4,35 @@ M = $(shell /bin/pwd)/../kernel
DESTDIR ?= /usr/local
HOST_EXTRACFLAGS += -I$(M) -I../lib -I$(ZIO)/include -Wno-trigraphs -Wall -ggdb
CFLAGS += -I$(M) -I../lib -I$(ZIO)/include -Wno-trigraphs -Wall -ggdb $(EXTRACFLAGS)
HOSTCC ?= gcc
CC ?= $(CROSS_COMPILE)gcc
hostprogs-y := fmc-fdelay-list
hostprogs-y += fmc-fdelay-term
hostprogs-y += fmc-fdelay-board-time
hostprogs-y += fmc-fdelay-input
hostprogs-y += fmc-fdelay-pulse
hostprogs-y += fmc-fdelay-status
progs := fmc-fdelay-list
progs += fmc-fdelay-term
progs += fmc-fdelay-board-time
progs += fmc-fdelay-input
progs += fmc-fdelay-pulse
progs += fmc-fdelay-status
# we are not in the kernel, so we need to piggy-back on "make modules"
all modules: $(hostprogs-y)
all modules: $(progs)
clean:
rm -f $(hostprogs-y) *.o *~
rm -f $(progs) *.o *~
$(hostprogs-y): tools-util.o tools-common.h $(wildcard ../lib/*.[ch])
$(progs): tools-util.o tools-common.h $(wildcard ../lib/*.[ch])
# make nothing for modules_install, but avoid errors
modules_install:
install:
install -d $(DESTDIR)/bin
install -D $(hostprogs-y) $(DESTDIR)/bin
install -D $(progs) $(DESTDIR)/bin
# we need this as we are out of the kernel
%: %.c $(wildcard *.h)
$(HOSTCC) $(HOST_EXTRACFLAGS) -O2 -Wall $*.c tools-util.o \
$(CC) $(CFLAGS) -O2 $*.c tools-util.o \
-L../lib -lfdelay -o $@
%.o: %.c $(wildcard *.h)
$(HOSTCC) $(HOST_EXTRACFLAGS) -O2 -Wall -c $*.c -o $@
$(CC) $(CFLAGS) -O2 -c $*.c -o $@
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