Skip to content

Commit

Permalink
install option, including expanded shmem.h
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesaross committed Sep 8, 2019
1 parent a7e2ac5 commit 496b1f5
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions src/Makefile.esdk
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
CC = epiphany-elf-gcc
CPP = epiphany-elf-cpp
AR = epiphany-elf-ar
READELF = epiphany-elf-readelf
DEFS = -O3 -Wall -Wno-unused-function -fno-unroll-loops -mfp-mode=caller
CFLAGS += -Os -Wall -Wno-unused-function
#DEFS += -DSHMEM_USE_HEADER_ONLY # Uncomment to build header only library
INCS =
LIBS =

ifeq ($(PREFIX),)
PREFIX := /usr/local
endif

TARGETS = libshmem_esdk.a libshmem.a

SRC_FILES = $(wildcard *.c)
ASM_FILES = $(wildcard *.S)

OBJS = $(SRC_FILES:.c=.elf) $(ASM_FILES:.S=.o)

all: $(TARGETS)
all: $(TARGETS) expanded_shmem.h

.PHONY: clean install uninstall
.PHONY: clean distclean install uninstall

.SUFFIXES:
.SUFFIXES: .S .c .o .elf
Expand All @@ -34,10 +40,20 @@ libshmem.a: libshmem_esdk.a
ln -sf $< $@

.S.o:
$(CC) -c $<
$(CC) $(DEFS) -c $<

expanded_shmem.h:
$(CPP) $(DEFS) -E shmem.h > expanded_shmem.h

clean:
rm -f *.elf *.o

distclean: clean
distclean: clean
rm -f *.a
rm -f expanded_shmem.h

install: all expanded_shmem.h
install -d $(DESTDIR)$(PREFIX)/lib/
install -m 644 $(TARGETS) $(DESTDIR)$(PREFIX)/lib/
install -d $(DESTDIR)$(PREFIX)/include/
install -m 644 expanded_shmem.h $(DESTDIR)$(PREFIX)/include/shmem.h

0 comments on commit 496b1f5

Please sign in to comment.