Commit 62c34f74 authored by Adam Wujek's avatar Adam Wujek 💬

tools: use implicit rules in Makefile

Such change simplifies support for external build environment.
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent bd9ee169
......@@ -8,13 +8,16 @@
# include parent_common.mk for buildsystem's defines
REPO_PARENT=../..
-include $(REPO_PARENT)/fmc_common.mk
M = $(shell /bin/pwd)/../kernel
DESTDIR ?= /usr/local
CFLAGS += -I$(M) -I../lib -I$(ZIO)/include -Wno-trigraphs -Wall -ggdb $(EXTRACFLAGS)
LDFLAGS = -L../lib
LDLIBS = -lfdelay
CC ?= $(CROSS_COMPILE)gcc
progs := fmc-fdelay-list
......@@ -30,7 +33,9 @@ all modules: $(progs)
clean:
rm -f $(progs) *.o *~
$(progs): tools-util.o tools-common.h $(wildcard ../lib/*.[ch])
COMMON_SRCS = tools-util.c
$(progs): $(COMMON_SRCS:.c=.o)
# make nothing for modules_install, but avoid errors
modules_install:
......@@ -39,9 +44,3 @@ install:
install -d $(DESTDIR)/bin
install -D $(progs) $(DESTDIR)/bin
# we need this as we are out of the kernel
%: %.c $(wildcard *.h)
$(CC) $(CFLAGS) -O2 $*.c tools-util.o \
-L../lib -lfdelay -o $@
%.o: %.c $(wildcard *.h)
$(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