forked from freebasic/fbfrog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
48 lines (34 loc) · 1.15 KB
/
makefile
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
40
41
42
43
44
45
46
47
48
FBC := fbc
FBFROG := $(shell $(FBC) -m fbfrog -print x)
TESTSRUN := $(shell $(FBC) tests/run.bas -print x)
prefix := /usr/local
-include config.mk
ALLFBCFLAGS := -m fbfrog -maxerr 1 $(FBFLAGS)
ALLFBLFLAGS := $(FBFLAGS)
SOURCES := $(sort $(wildcard src/*.bas))
HEADERS := $(wildcard src/*.bi)
OBJECTS := $(patsubst src/%.bas,src/obj/%.o,$(SOURCES))
# We don't want to use any of make's built-in suffixes/rules
.SUFFIXES:
ifndef V
QUIET_FBC = @echo "FBC $<";
QUIET_FBCLINK = @echo "FBCLINK $@";
endif
build: $(FBFROG) $(TESTSRUN)
$(FBFROG): $(OBJECTS)
$(QUIET_FBCLINK)$(FBC) $(ALLFBLFLAGS) $^ -x $@
$(OBJECTS): src/obj/%.o: src/%.bas $(HEADERS)
$(QUIET_FBC)$(FBC) $(ALLFBCFLAGS) $< -c -o $@
$(TESTSRUN): tests/run.bas src/util-path.bas src/util-str.bas
$(QUIET_FBCLINK)$(FBC) $< $(FBFLAGS)
tests: build
$(TESTSRUN)
clean:
rm -f $(FBFROG) $(TESTSRUN) src/obj/*.o
install:
install $(FBFROG) "$(prefix)/bin"
cp -R include/fbfrog "$(prefix)/include"
COMMIT = $(shell git rev-parse --verify HEAD)
tarball:
git archive --format tar --prefix "fbfrog-$(COMMIT)/" $(COMMIT) | xz --stdout > fbfrog-$(COMMIT).tar.xz
.PHONY: all tests clean install tarball