forked from emmanuel-marty/apultra
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request emmanuel-marty#18 from Octoate/create-library
Build libapultra.a and use it for the cli program
- Loading branch information
Showing
1 changed file
with
24 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,36 @@ | ||
CC=clang | ||
AR=ar | ||
CFLAGS=-O3 -g -fomit-frame-pointer -Isrc/libdivsufsort/include -Isrc | ||
OBJDIR=obj | ||
LDFLAGS= | ||
LDFLAGS=-L. -lapultra | ||
|
||
$(OBJDIR)/%.o: src/../%.c | ||
@mkdir -p '$(@D)' | ||
$(CC) $(CFLAGS) -c $< -o $@ | ||
@mkdir -p '$(@D)' | ||
$(CC) $(CFLAGS) -c $< -o $@ | ||
|
||
APP := apultra | ||
LIB := libapultra.a | ||
|
||
OBJS += $(OBJDIR)/src/apultra.o | ||
OBJS += $(OBJDIR)/src/expand.o | ||
OBJS += $(OBJDIR)/src/matchfinder.o | ||
OBJS += $(OBJDIR)/src/shrink.o | ||
OBJS += $(OBJDIR)/src/libdivsufsort/lib/divsufsort.o | ||
OBJS += $(OBJDIR)/src/libdivsufsort/lib/divsufsort_utils.o | ||
OBJS += $(OBJDIR)/src/libdivsufsort/lib/sssort.o | ||
OBJS += $(OBJDIR)/src/libdivsufsort/lib/trsort.o | ||
LIBOBJS += $(OBJDIR)/src/expand.o | ||
LIBOBJS += $(OBJDIR)/src/matchfinder.o | ||
LIBOBJS += $(OBJDIR)/src/shrink.o | ||
LIBOBJS += $(OBJDIR)/src/libdivsufsort/lib/divsufsort.o | ||
LIBOBJS += $(OBJDIR)/src/libdivsufsort/lib/divsufsort_utils.o | ||
LIBOBJS += $(OBJDIR)/src/libdivsufsort/lib/sssort.o | ||
LIBOBJS += $(OBJDIR)/src/libdivsufsort/lib/trsort.o | ||
|
||
all: $(APP) | ||
APPOBJS := $(OBJDIR)/src/apultra.o | ||
|
||
$(APP): $(OBJS) | ||
$(CC) $^ $(LDFLAGS) -o $(APP) | ||
all: $(APP) $(LIB) | ||
|
||
clean: | ||
@rm -rf $(APP) $(OBJDIR) | ||
$(APP): $(LIB) $(APPOBJS) | ||
$(CC) $^ $(LDFLAGS) -o $(APP) | ||
|
||
$(LIB): $(LIBOBJS) | ||
$(AR) rcs $(LIB) $(LIBOBJS) | ||
|
||
libs: $(LIB) | ||
|
||
clean: | ||
@rm -rf $(APP) $(OBJDIR) | ||
@rm -rf $(LIB) |