Make
This commit is contained in:
parent
65e01e3f9f
commit
c83cf1efd8
1 changed files with 25 additions and 0 deletions
25
Makefile
Normal file
25
Makefile
Normal file
|
@ -0,0 +1,25 @@
|
|||
CC := gcc
|
||||
CFLAGS := -Wall -Wextra -O2
|
||||
#CFLAGS += -std=c99 # C99 breaks sbrk for some reason (likely toolchain bug)
|
||||
LIBS := -lsqlite3
|
||||
|
||||
SRC := $(wildcard *.c)
|
||||
OBJ := $(SRC:.c=.o)
|
||||
ELF := $(SRC:.c=.elf)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
%.elf: %.o
|
||||
$(CC) $(LIBS) -o $@ $<
|
||||
|
||||
all: $(ELF)
|
||||
|
||||
tags:
|
||||
ctags -R .
|
||||
|
||||
compile_commands.json:
|
||||
bear -- make
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJ) $(ELF) *.json .cache
|
Loading…
Add table
Reference in a new issue