forked from lizj3624/https-github.com-mogutt-TTServer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (26 loc) · 700 Bytes
/
Copy pathMakefile
File metadata and controls
32 lines (26 loc) · 700 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
LIBBASE = libbase.a
COMMON_PATH := ./
SRCDIRS := ./
CPPFLAGS += -fPIC -I$(COMMON_PATH)
CPPFLAGS += -Wall -Wno-deprecated -g
SRCEXTS := .c .cpp
CC = g++
SHELL = /bin/sh
SOURCES = $(foreach d,$(SRCDIRS),$(wildcard $(addprefix $(d)/*,$(SRCEXTS))))
OBJS= $(patsubst %.cpp,./obj/%.o,$(notdir $(SOURCES)))
GCNOS= $(patsubst %.cpp,./obj/%.gcno,$(notdir $(SOURCES)))
all: $(LIBBASE)
$(LIBBASE): $(OBJS)
ar -r $@ $(OBJS)
objs : $(OBJS)
./obj/%.o : %.c
gcc -c $(CPPFLAGS) $(CFLAGS) $< -o $(patsubst %.c,%.o, $<)
./obj/%.o : %.cpp
@mkdir -p $(dir $@)
@echo "=================="
@echo "Compiling $<"
$(CC) -c $(CPPFLAGS) $< -o $@
.PHONY : clean
clean:
rm -f $(OBJS)
rm -f $(LIBBASE)