aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 94e43d65109e0c323091ad32a6ca6a91390b39b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
CC=tcc
CFLAGS=-g
SRC=src
OBJ=obj
SOURCES=$(wildcard $(SRC)/*.c)
OBJECTS=$(patsubst $(SRC)/%.c, $(OBJ)/%.o, $(SOURCES))
BIN=main


run: $(BIN)
	./$(BIN)

build: $(BIN)

$(BIN): $(OBJECTS)
	$(CC) $(CFLAGS) $(OBJECTS) -o $(BIN)

$(OBJ)/%.o: $(SRC)/%.c $(SRC)/*.h
	$(CC) -c $< -o $@

clean:
	rm -r $(BIN) $(OBJ)/*.o