gmqcc/Makefile

37 lines
686 B
Makefile
Raw Normal View History

CC ?= clang
CFLAGS = -MD -Wall -Wextra -pedantic-errors
LDFLAGS = -lm
2012-12-20 00:22:22 +00:00
CSRCS = ansi.c ast.c code.c conout.c fold.c fs.c ftepp.c hash.c intrin.c ir.c lexer.c main.c opts.c parser.c stat.c utf8.c util.c
TSRCS = ansi.c conout.c fs.c hash.c opts.c stat.c test.c util.c
2012-11-17 10:00:32 +00:00
COBJS = $(CSRCS:.c=.o)
TOBJS = $(TSRCS:.c=.o)
CDEPS = $(CSRCS:.c=.d)
TDEPS = $(TSRCS:.c=.d)
CBIN = gmqcc
TBIN = testsuite
all: $(CBIN) $(TBIN)
$(CBIN): $(COBJS)
2015-01-14 01:27:45 +00:00
$(CC) $(COBJS) $(LDFLAGS) -o $@
$(TBIN): $(TOBJS)
2015-01-14 01:27:45 +00:00
$(CC) $(TOBJS) $(LDFLAGS) -o $@
.c.o:
$(CC) -c $(CFLAGS) $< -o $@
2012-11-17 10:00:55 +00:00
test: $(CBIN) $(TBIN)
@./$(TBIN)
2012-04-09 10:42:06 +00:00
clean:
rm -f *.d
rm -f $(COBJS) $(CDEPS) $(CBIN)
rm -f $(TOBJS) $(TDEPS) $(TBIN)
2015-01-14 01:29:46 +00:00
-include *.d