-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (36 loc) · 898 Bytes
/
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
export CXX = g++
export CC = gcc
export CXXDEP = g++ -MM *.cpp
export LD = ld
export AR = ar
export RANLIB = ranlib
export RM = rm
export CLANG_FORMAT = clang-format
export FIND = find
export XARGS = xargs
export OBJS := new_emulator.o
export CXXFLAGS += -std=c++23 -g -O2 -fsanitize=undefined -fsanitize=address -Wall -Wextra
export CFLAGS += -std=c2x -g -O2 -fsanitize=undefined -fsanitize=address -Wall -Wextra
export LDFLAGS =
all: dep.mk $(OBJS)
dep dep.mk: $(shell ls *.cpp)
@echo [CXXDEP] $@
@$(CXXDEP) $(CXXFLAGS) > dep.mk
%.o: %.c
@echo [CC] $<
@$(CC) $(CFLAGS) $< -c
%.o: %.cpp
@echo [CXX] $<
@$(CXX) $(CXXFLAGS) $< -c
%.so: $(OBJS)
@echo [LD] $@
@$(LD) $(LDFLAGS) $(OBJS) -shared -o $@
%.a: $(OBJS)
@echo [AR] $@
@$(AR) rc $@ $(OBJS)
@echo [RANLIB] $@
@$(RANLIB) $@
clean:
@echo [RM] $(LIBS) $(OBJS) dep.mk
-@$(RM) -f $(LIBS) $(OBJS) dep.mk
include dep.mk