use makefile instead simple build.sh #7
This commit is contained in:
parent
204aaad082
commit
8dac3405ec
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -13,4 +13,4 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
- name: Run build script
|
||||
run: |
|
||||
./build.sh
|
||||
make
|
||||
|
||||
20
Makefile
Normal file
20
Makefile
Normal file
@ -0,0 +1,20 @@
|
||||
CC = gcc
|
||||
CFLAGS = -Wall -ggdb
|
||||
SRCS = $(shell find ./src -type f -name "*.c")
|
||||
BUILD_DIR = $(shell git rev-parse --show-toplevel)/build
|
||||
OBJS = $(SRCS:.c=.o)
|
||||
|
||||
all: $(BUILD_DIR)/cdo
|
||||
|
||||
$(BUILD_DIR)/cdo: $(OBJS)
|
||||
@mkdir -p $(BUILD_DIR)
|
||||
$(CC) $(CFLAGS) -o $@ $^
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf $(BUILD_DIR) $(OBJS)
|
||||
|
||||
.PHONY: all
|
||||
Loading…
x
Reference in New Issue
Block a user