Skip to content

Commit

Permalink
Configure build script for the static library
Browse files Browse the repository at this point in the history
  • Loading branch information
61315 committed Feb 6, 2022
1 parent 4a5bcb0 commit 0207f72
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/build
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
CC = clang
TARGET_LIB := libresynthesizer.a

BUILD_DIR := build
SRC_DIRS := resynthesizer

SRCS := $(shell find $(SRC_DIRS) -name '*.c')
OBJS := $(SRCS:%=$(BUILD_DIR)/%.o)

INC_DIRS := $(shell find $(SRC_DIRS) -type d)
INC_FLAGS := $(addprefix -I,$(INC_DIRS))

CFLAGS := $(INC_FLAGS) -MMD -MP -DSYNTH_LIB_ALONE

$(BUILD_DIR)/$(TARGET_LIB): $(OBJS)
ar rvs $@ $^

$(BUILD_DIR)/%.c.o: %.c
mkdir -p $(dir $@)
$(CC) $(CFLAGS) -c $< -o $@

.PHONY: clean
clean:
rm -r $(BUILD_DIR)
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
# resynthesizer

WIP

## Building libresynthesizer.a

### macOS

To compile resynthesizer you must have Xcode installed and you need to make sure the command line tools are setup by running:

```
$ xcode-select --install
```

After that you can build the static library simply by:

```
$ make
```

0 comments on commit 0207f72

Please sign in to comment.