Skip to content

Commit

Permalink
2018-12-15 19:05:09 CST W50D6
Browse files Browse the repository at this point in the history
  • Loading branch information
aggresss committed Dec 15, 2018
1 parent 05131af commit 6ee8fcf
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions library/apr_test/src/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Makefile for xxxx
CC = gcc
CXX = g++
CFLAGS = -g
CXXFLAGS = -g -std=c++14
OBJS = $(patsubst %c, %o, $(wildcard *.c))
OBJS += $(patsubst %cpp, %o, $(wildcard *.cpp))
HEADER = $(wildcard ../include/*.h)


PATH_REPO=$(shell git rev-parse --show-toplevel)
PATH_PWD=$(shell pwd)
PATH_LIB=$(PATH_PWD)/../lib
PATH_XXXX=$(PATH_LIB)/xxxx
PATH_XXXX_PREFIX=$(PATH_XXXX)/prefix

CFLAGS += -I$(PATH_XXXX_PREFIX)/include
CXXFLAGS += -I$(PATH_XXXX_PREFIX)/include
LDFLAGS += -L$(PATH_XXXX_PREFIX)/lib -lxxxx
LDFLAGS += -lpthread -ldl -lrt

Target = xxxx_test.out

all: $(Target)

DEPS := $(OBJS:.o=.d)
-include $(DEPS)
CFLAGS += -MMD -MP
CXXFLAGS += -MMD -MP

%.o:%.cpp $(HEADER)
$(CXX) $(CXXFLAGS) -c $< -o $@

%.o:%.c $(HEADER)
$(CC) $(CFLAGS) -c $< -o $@

$(Target):$(OBJS)
$(CXX) -o $@ $^ $(LDFLAGS)

.PHONY:clean
clean:
rm -rf *.o $(Target)

0 comments on commit 6ee8fcf

Please sign in to comment.