mirror of
https://github.com/guezoloic/t3dsr.git
synced 2026-01-25 10:34:23 +00:00
chore: Initialize basic targets in Makefile
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -50,3 +50,5 @@ modules.order
|
|||||||
Module.symvers
|
Module.symvers
|
||||||
Mkfile.old
|
Mkfile.old
|
||||||
dkms.conf
|
dkms.conf
|
||||||
|
|
||||||
|
build
|
||||||
34
Makefile
Normal file
34
Makefile
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
EXE = t3dsr
|
||||||
|
|
||||||
|
INC = include
|
||||||
|
SRC = src
|
||||||
|
TST = test
|
||||||
|
BLD = build
|
||||||
|
|
||||||
|
DEBUG_DIR = $(BLD)/debug
|
||||||
|
|
||||||
|
CC = clang
|
||||||
|
CFLAGS = -Wall -Wextra -I$(INC) -g
|
||||||
|
|
||||||
|
SRCS = $(shell find $(SRC) -name "*.c")
|
||||||
|
OBJS = $(SRCS:$(SRC)/%.c=$(DEBUG_DIR)/%.o)
|
||||||
|
|
||||||
|
$(EXE): $(OBJS) | $(DEBUG_DIR)
|
||||||
|
@$(CC) $^ -o $(BLD)/$@
|
||||||
|
|
||||||
|
$(DEBUG_DIR):
|
||||||
|
@mkdir -p $(DEBUG_DIR)
|
||||||
|
|
||||||
|
$(DEBUG_DIR)/%.o: $(SRC)/%.c | $(DEBUG_DIR)
|
||||||
|
@mkdir -p $(dir $@)
|
||||||
|
@$(CC) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
|
clean:
|
||||||
|
@rm -rf $(BLD) $(EXE)
|
||||||
|
|
||||||
|
run: $(EXE)
|
||||||
|
@./$(BLD)/$(EXE)
|
||||||
|
|
||||||
|
all: $(EXE)
|
||||||
|
|
||||||
|
.PHONY: all clean run
|
||||||
3
src/main.c
Normal file
3
src/main.c
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
int main() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user