-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
41 lines (31 loc) · 799 Bytes
/
makefile
File metadata and controls
41 lines (31 loc) · 799 Bytes
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
# Makefile for avalanche assembler
# By James Henderson, 2019
# Devantech Ltd
# www.robot-electronics.co.uk
vpath %.cpp src/utils
vpath %.cpp src/instruction
vpath %.cpp src/macro
vpath %.cpp src/data_types
vpath %.hpp src/includes
vpath %.cpp src
CXX := g++
LXX = g++
CXXFLAGS := -Os -std=c++11 -Isrc/includes -c
LXXFLAGS := -s -Os
# CXXFLAGS := -g -std=c++11 -Isrc/includes -c
# LXXFLAGS := -g
BUILDDIR := build
OBJDIR := $(BUILDDIR)/obj
SRCS := $(notdir $(shell find -name '*.cpp'))
OBJS := $(patsubst %.cpp, $(OBJDIR)/%.o, $(SRCS))
avalanche: builddir $(OBJS) $(SRCS)
$(LXX) $(LXXFLAGS) $(OBJS) -o $(BUILDDIR)/avasm
$(OBJDIR)/%.o: %.cpp
$(CXX) $(CXXFLAGS) $^ -o $@
.PHONY: builddir
builddir:
@mkdir -p $(OBJDIR)
.PHONY: clean
clean:
@rm -f -r build/obj/*.o
@rm -f build/avalanche