gmqcc/Makefile

45 lines
893 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
2015-01-14 01:36:25 +00:00
VSRCS = ansi.c exec.c fs.c hash.c stat.c util.c
2012-11-17 10:00:32 +00:00
COBJS = $(CSRCS:.c=.o)
TOBJS = $(TSRCS:.c=.o)
2015-01-14 01:36:25 +00:00
VOBJS = $(VSRCS:.c=.o)
CDEPS = $(CSRCS:.c=.d)
TDEPS = $(TSRCS:.c=.d)
2015-01-14 01:36:25 +00:00
VDEPS = $(VSRCS:.c=.d)
CBIN = gmqcc
TBIN = testsuite
2015-01-14 01:36:25 +00:00
VBIN = qcvm
2015-01-14 01:36:25 +00:00
all: $(CBIN) $(TBIN) $(VBIN)
$(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 $@
2015-01-14 01:36:25 +00:00
$(VBIN): $(VOBJS)
$(CC) $(VOBJS) $(LDFLAGS) -o $@
.c.o:
$(CC) -c $(CFLAGS) $< -o $@
2012-11-17 10:00:55 +00:00
2015-01-14 01:36:25 +00:00
test: $(CBIN) $(TBIN) $(VBIN)
@./$(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:36:25 +00:00
rm -f $(VOBJS) $(VDEPS) $(VBIN)
2015-01-14 01:29:46 +00:00
-include *.d