35 lines
684 B
Makefile
35 lines
684 B
Makefile
CFLAGS = -std=c99 -Wall
|
|
LDFLAGS = -lrt -lm
|
|
|
|
ifeq ($(DEBUG),yes)
|
|
CFLAGS += -g
|
|
PROFILE = no
|
|
dummy := $(shell rm -f rosella *.gcda *.gcno *.o)
|
|
else
|
|
CFLAGS += -O3 -DNDEBUG -march=nocona
|
|
endif
|
|
|
|
all: rosella
|
|
.PHONY: all clean
|
|
|
|
ifeq ($(PROFILE),yes)
|
|
CFLAGS += -fprofile-generate
|
|
LDFLAGS += -fprofile-generate
|
|
endif
|
|
|
|
ifneq (,$(wildcard *.gcda))
|
|
CFLAGS += -fprofile-use
|
|
dummy := $(shell rm -f rosella *.o)
|
|
endif
|
|
|
|
clean:
|
|
-rm -f rosella *.o *.gcda *.gcno
|
|
|
|
rosella: rosella.o gc.o builtin.o interp.o reader.o
|
|
|
|
rosella.o: rosella.c gc.h builtin.h interp.h
|
|
gc.o: gc.c gc.h
|
|
builtin.o: builtin.c builtin.h gc.h
|
|
interp.o: interp.c interp.h gc.h builtin.h
|
|
reader.o: reader.c reader.h gc.h builtin.h
|