Skip to content

Commit 628f4e9

Browse files
committed
ex: Add makefile to build examples from installed lib
Change-Id: I10a51dfe90e0672bb33348de241a5be91c9caa37 Signed-off-by: Greg Tucker <[email protected]>
1 parent 0f7bf1c commit 628f4e9

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

examples/ec/Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Build examples from installed lib
2+
3+
include Makefile.am
4+
5+
incdir = $(shell pkg-config --variable=includedir libisal)
6+
7+
CFLAGS += -include $(incdir)/isa-l.h # Add standard header
8+
CFLAGS += -I $(incdir)/isa-l # Add path to remove error
9+
LDFLAGS = $(shell pkg-config --libs libisal)
10+
11+
progs = $(notdir $(examples))
12+
13+
ex: $(progs)
14+
run: $(addsuffix .run,$(progs))
15+
16+
$(progs): % : %.c
17+
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
18+
19+
$(addsuffix .run,$(progs)): %.run : %
20+
./$<
21+
@echo Completed run: $<
22+
23+
clean:
24+
$(RM) $(progs)

examples/ec/Makefile.unx

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)