forked from Thealexbarney/LibAtrac9
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
520109f
commit 54b469e
Showing
14 changed files
with
1,353 additions
and
1,291 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
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
NAME = libatrac9 | ||
|
||
CC = gcc | ||
AR = ar | ||
SFLAGS = -O2 | ||
CFLAGS = -Wall -Wextra -std=c99 | ||
LFLAGS = | ||
SHARED_SFLAGS = $(SFLAGS) -flto | ||
SHARED_CFLAGS = $(CFLAGS) -fPIC | ||
SHARED_LFLAGS = $(LFLAGS) -shared | ||
|
||
SRCDIR = src | ||
OBJDIR = obj | ||
BINDIR = bin | ||
|
||
STATIC_OBJDIR = $(OBJDIR)_static | ||
SHARED_OBJDIR = $(OBJDIR)_shared | ||
SRCS = $(wildcard $(SRCDIR)/*.c) | ||
STATIC_OBJS = $(SRCS:$(SRCDIR)/%.c=$(STATIC_OBJDIR)/%.o) | ||
SHARED_OBJS = $(SRCS:$(SRCDIR)/%.c=$(SHARED_OBJDIR)/%.o) | ||
|
||
STATIC_NAME = $(BINDIR)/$(NAME).a | ||
SHARED_NAME = $(BINDIR)/$(NAME).so | ||
|
||
MKDIR = mkdir -p | ||
RM = rm -f | ||
RMDIR = rm -df | ||
|
||
all: static shared | ||
static: create_static_dir create_bin_dir $(STATIC_NAME) | ||
shared: create_shared_dir create_bin_dir $(SHARED_NAME) | ||
|
||
create_static_dir: | ||
@$(MKDIR) $(STATIC_OBJDIR) | ||
|
||
create_shared_dir: | ||
@$(MKDIR) $(SHARED_OBJDIR) | ||
|
||
create_bin_dir: | ||
@$(MKDIR) $(BINDIR) | ||
|
||
$(SHARED_NAME): $(SHARED_OBJS) | ||
$(CC) $(SHARED_OBJS) $(SHARED_SFLAGS) $(SHARED_LFLAGS) -o $@ | ||
|
||
$(SHARED_OBJS): $(SHARED_OBJDIR)/%.o : $(SRCDIR)/%.c | ||
$(CC) $(SHARED_SFLAGS) $(SHARED_CFLAGS) -c $< -o $@ | ||
|
||
$(STATIC_NAME): $(STATIC_OBJS) | ||
$(AR) rcs $@ $^ | ||
|
||
$(STATIC_OBJS): $(STATIC_OBJDIR)/%.o : $(SRCDIR)/%.c | ||
$(CC) $(SFLAGS) $(CFLAGS) -c $< -o $@ | ||
|
||
clean: | ||
$(RM) $(SHARED_OBJS) $(SHARED_NAME) $(STATIC_OBJS) $(STATIC_NAME) | ||
-@$(RMDIR) $(STATIC_OBJDIR) $(SHARED_OBJDIR) $(BINDIR) 2>/dev/null || true | ||
|
||
.PHONY: all static shared create_static_dir create_shared_dir create_bin_dir clean |
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
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
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
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 |
---|---|---|
|
@@ -30,4 +30,4 @@ typedef enum at9_status | |
if (status != ERR_SUCCESS) { \ | ||
return status; \ | ||
} \ | ||
} while (0) | ||
} while (0) |
Oops, something went wrong.