summaryrefslogtreecommitdiff
path: root/util/romcc/Makefile
blob: 2c5f174cf22ac31fcd87e9ecf4a834cde0a476f7 (plain)
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
CC=gcc
CPPFLAGS=
CFLAGS= -g -Wall -Werror $(CPPFLAGS)
CPROF_FLAGS=-pg -fprofile-arcs
BUILD_DIR=build

default: $(BUILD_DIR)/romcc

$(BUILD_DIR)/romcc: romcc.c $(BUILD_DIR)
	$(CC) $(CFLAGS) -o $@ $<

$(BUILD_DIR)/romcc_pg: romcc.c $(BUILD_DIR)
	$(CC) $(CFLAGS) $(CPROF_FLAGS) -o $@ $<

$(BUILD_DIR):
	mkdir -p $(BUILD_DIR)

test: $(BUILD_DIR)/romcc
	./test.sh all

test-simple: $(BUILD_DIR)/romcc
	./test.sh simple

test-linux: $(BUILD_DIR)/romcc
	./test.sh linux

clean distclean:
	rm -rf $(BUILD_DIR)

.PHONY: all test test-simple test-linux clean distclean