Makefile 1.28 KB
Newer Older
1
2
3
# SPDX-License-Identifier: MIT

include ../config.mk
4
include ../libversion.mk
Philippe Gerum's avatar
Philippe Gerum committed
5

6
7
8
SRCFILES := $(wildcard *.c)
TARGETS = $(SRCFILES:%.c=$(O_DIR)/%)
DEPFILES = $(SRCFILES:%.c=$(O_DIR)/%.d)
Philippe Gerum's avatar
Philippe Gerum committed
9
COMMANDS = evl
10

11
12
13
14
15
16
17
18
HELPER_SCRIPTS =		\
	evl-gdb			\
	evl-help		\
	evl-test		\
	evl-trace		\
	trace.evl		\
	trace.irq		\
	trace.timer		\
19
	kconf-checklist.evl
20

21
HELPER_PROGRAMS = evl-check evl-ps
Philippe Gerum's avatar
Philippe Gerum committed
22

23
CMD_CPPFLAGS := $(BASE_CPPFLAGS) -I. -I../include -I$(O_DIR)/../include
Philippe Gerum's avatar
Philippe Gerum committed
24
25
26
CMD_CFLAGS := $(CMD_CPPFLAGS) $(BASE_CFLAGS)
override CFLAGS := $(CMD_CFLAGS) $(CFLAGS)

27
28
29
CMD_LDFLAGS := $(O_DIR)/../lib/libevl.so.$(EVL_IVERSION) -lpthread -lrt
override LDFLAGS := $(CMD_LDFLAGS) $(LDFLAGS)

30
$(TARGETS):
31

32
all: output-Makefile $(DEPFILES) $(TARGETS)
Philippe Gerum's avatar
Philippe Gerum committed
33

34
install install_all: all
35
	$(call inst-cmd,utilities,						\
Philippe Gerum's avatar
Philippe Gerum committed
36
		for bin in $(COMMANDS); do					\
37
		$(INSTALL) -D $(O_DIR)/$$bin -t $(DESTDIR)/$(bindir); done)
38
	$(call inst-cmd,command-helpers,					\
Philippe Gerum's avatar
Philippe Gerum committed
39
		for hlp in $(HELPER_SCRIPTS); do				\
40
		$(INSTALL) -D  $$hlp -t $(DESTDIR)/$(libexecdir); done;		\
Philippe Gerum's avatar
Philippe Gerum committed
41
		for hlp in $(HELPER_PROGRAMS); do				\
42
		$(INSTALL) -D $(O_DIR)/$$hlp -t $(DESTDIR)/$(libexecdir); done)
Philippe Gerum's avatar
Philippe Gerum committed
43

44
clean clobber mrproper: output-Makefile
Philippe Gerum's avatar
Philippe Gerum committed
45
46
	$(Q)$(RM) -f $(TARGETS) $(DEPFILES)

47
$(O_DIR)/%: %.c $(O_DIR)/%.d
Philippe Gerum's avatar
Philippe Gerum committed
48
49
50
	$(call ccld-cmd,$@,$(Q)$(CC) -o $(@) $< $(CFLAGS) $(LDFLAGS))

-include $(DEPFILES)