-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (27 loc) · 727 Bytes
/
Makefile
File metadata and controls
38 lines (27 loc) · 727 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
OBJDIR = lib
BUILDDIR = bin
rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))
CPPSRC=$(call rwildcard,./,*.c)
OBJS=$(patsubst %.c, $(OBJDIR)/%.o, $(CPPSRC))
CFLAGS = -O3 -Wall -I./include -fno-objc-arc $(USER_CFLAGS)
CC = clang
CXX = clang
build: $(OBJS)
@echo LINKING $(BUILDDIR)/iasm
@$(CXX) $(OBJS) -o $(BUILDDIR)/iasm $(LDFLAGS)
$(OBJDIR)/%.o: %.c
@echo "CC $^ -> $@"
@mkdir -p $(@D)
@$(CC) -c $^ -o $@ $(CFLAGS) -O3
delete_tmp:
@echo "Deleting tmp directories"
@rm -rf $(OBJDIR)
@rm -rf $(BUILDDIR)
setup:
@echo "Creating tmp directories"
@mkdir -p $(OBJDIR)
@mkdir -p $(BUILDDIR)
clean: delete_tmp setup
run: build
@$(BUILDDIR)/iasm
.PNONY: clean run