~bl4ckb0ne/boson

ref: eb8abea2d3578e3a27a996e8d3b8bda7032a5daa boson/Makefile -rw-r--r-- 717 bytes
eb8abea2Simon Zeni ninja: fix compiler check a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
.POSIX:
VERSION=0.0.1

INCLUDE=-Iinclude
FLAGS=-g -Wall -Wextra -Werror -Wno-unused-parameter -DVERSION='"$(VERSION)"' -fno-common $(CFLAGS)
LDFLAGS=-static

OUTDIR?=build
.DEFAULT_GOAL=all

OBJECTS=\
	$(OUTDIR)/getopt_long.o \
	$(OUTDIR)/hash_table.o \
	$(OUTDIR)/log.o \
	$(OUTDIR)/ninja.o \
	$(OUTDIR)/options.o \
	$(OUTDIR)/object.o \
	$(OUTDIR)/builtin.o \
	$(OUTDIR)/interpreter.o \
	$(OUTDIR)/ast.o \
	$(OUTDIR)/token.o \
	$(OUTDIR)/lexer.o \
	$(OUTDIR)/parser.o \
	$(OUTDIR)/setup.o \
	$(OUTDIR)/main.o

$(OUTDIR)/%.o: src/%.c
	@mkdir -p $(OUTDIR)
	cc -std=c11 -pedantic -c -o $@ $(FLAGS) $(INCLUDE) $<

boson: $(OBJECTS)
	cc $(LDFLAGS) -o $@ $^

all: boson

clean:
	rm -rf boson $(OUTDIR)

.PHONY: all clean