|
| 1 | + |
| 2 | + |
| 3 | +#-----------------------------------------------------------# |
| 4 | +# # |
| 5 | +# LoopParallelism Library V3.0 # |
| 6 | +# # |
| 7 | +#-----------------------------------------------------------# |
| 8 | +# # |
| 9 | +# Description: Handles threads, scheduling # |
| 10 | +# & dependencies # |
| 11 | +# Author: Loic MARECHAL # |
| 12 | +# Creation date: feb 25 2008 # |
| 13 | +# Last modification: mar 12 2010 # |
| 14 | +# # |
| 15 | +#-----------------------------------------------------------# |
| 16 | + |
| 17 | + |
| 18 | +CC = /usr/bin/gcc |
| 19 | +CFLAGS = -O3 |
| 20 | + |
| 21 | + |
| 22 | +# Working directories |
| 23 | + |
| 24 | +LIBDIR = $(HOME)/lib/$(ARCHI) |
| 25 | +INCDIR = $(HOME)/include |
| 26 | +SRCSDIR = sources |
| 27 | +OBJSDIR = objects/$(ARCHI) |
| 28 | +ARCHDIR = archives |
| 29 | +DIRS = objects $(LIBDIR) $(OBJSDIR) $(ARCHDIR) $(INCDIR) |
| 30 | +VPATH = $(SRCSDIR) |
| 31 | + |
| 32 | + |
| 33 | +# Files to be compiled |
| 34 | + |
| 35 | +SRCS = $(wildcard $(SRCSDIR)/*.c) |
| 36 | +HDRS = $(wildcard $(SRCSDIR)/*.h) |
| 37 | +OBJS = $(patsubst $(SRCSDIR)%, $(OBJSDIR)%, $(SRCS:.c=.o)) |
| 38 | +LIB = lplib3.a |
| 39 | + |
| 40 | + |
| 41 | +# Definition of the compiling implicit rule |
| 42 | + |
| 43 | +$(OBJSDIR)/%.o : $(SRCSDIR)/%.c |
| 44 | + $(CC) -c $(CFLAGS) -I$(SRCSDIR) $< -o $@ |
| 45 | + |
| 46 | + |
| 47 | +# Install the library |
| 48 | + |
| 49 | +$(LIBDIR)/$(LIB): $(DIRS) $(OBJS) |
| 50 | + cp $(OBJSDIR)/lplib3.o $@ |
| 51 | + cp $(SRCSDIR)/*lplib3.h $(SRCSDIR)/*lplib3.ins $(INCDIR) |
| 52 | + |
| 53 | + |
| 54 | +# Objects depends on headers |
| 55 | + |
| 56 | +$(OBJS): $(HDRS) |
| 57 | + |
| 58 | + |
| 59 | +# Build the working directories |
| 60 | + |
| 61 | +$(DIRS): |
| 62 | + @[ -d $@ ] || mkdir $@ |
| 63 | + |
| 64 | + |
| 65 | +# Remove temporary files |
| 66 | + |
| 67 | +clean: |
| 68 | + rm -f $(OBJS) $(LIBDIR)/$(LIB) |
| 69 | + |
| 70 | +# Build a dated archive including sources, patterns and makefile |
| 71 | + |
| 72 | +tar: $(DIRS) |
| 73 | + tar czf $(ARCHDIR)/lplib3.`date +"%Y.%m.%d"`.tgz sources Makefile |
| 74 | + |
| 75 | +zip: $(DIRS) |
| 76 | + archive_lp3.sh |
0 commit comments