-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
executable file
·88 lines (70 loc) · 2.24 KB
/
Copy pathmakefile
File metadata and controls
executable file
·88 lines (70 loc) · 2.24 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File Name: makefile
# Build Date: Tue, Aug 12, 2025 9:26:00 PM
# Version: 0.1.1
APP=scanpf
CXX=g++
CXXFLAGS=-Wall -std=c++20 -fPIC
CXXCPP?=
LDFLAGS?=
LIBS?=
SRC=/home/brian/src/scanpf/src
BLD=/home/brian/src/scanpf/build
OBJ=$(BLD)
# lib settings
LIBS = -L/usr/local/lib/
INCLUDES = -I/usr/local/include/cppunit/
LDFLAGS = $(LIBS) $(INCLUDES)
# lib settings
LIBS=-L/usr/local/lib/
INCLUDES=-I/usr/local/include/cppunit/
ifndef RELEASE
CXXFLAGS +=-ggdb -DDEBUG
LDFLAGS=$(INCLUDES) $(LIBS) /usr/local/libcppunit.a
endif
ifdef CYGWIN
CXXFLAGS +=-DCYGWIN
LDFLAGS=$(INCLUDES) $(LIBS) /usr/lib/libcppunit.dll.a
endif
all: $(BLD)/scanpf $(BLD)/scanpf_test $(BLD)/scanrf $(BLD)/scanrf_test
rebuild: clean all
debug: CXXFLAGS += -DDEBUG -g
debug: scanpf
debuggdb: CXXFLAGS += -DDEBUG -ggdb
debuggdb: scanpf
$(BLD)/scanpf: $(BLD)/scanpf.o $(BLD)/main.o
$(CXX) $(CXXFLAGS) $(OBJ)/scanpf.o $(OBJ)/main.o -o $(BLD)/scanpf
$(BLD)/scanrf: $(BLD)/scanrf.o $(BLD)/main.o
$(CXX) $(CXXFLAGS) $(OBJ)/scanrf.o $(OBJ)/main.o -o $(BLD)/scanrf
$(BLD)/$(APP)_test: $(OBJ)/$(APP).o $(OBJ)/$(APP)_test.o
$(CXX) $(CXXFLAGS) $^ $(LDFLAGS) -o $@
$(BLD)/scanrf_test: $(OBJ)/scanrf.o $(OBJ)/scanrf_test.o
$(CXX) $(CXXFLAGS) $^ $(LDFLAGS) -o $@
$(BLD)/unit_test: $(BLD)/unit_test.o $(BLD)/000-CatchMain.o
$(CXX) $(CXXFLAGS) $(BLD)/unit_test.o $(BLD)/000-CatchMain.o $(BLD)/utility.o -o $(BLD)/unit_test
$(OBJ)/%.o: $(SRC)/%.cpp
$(CXX) $(CXXFLAGS) -c $^ -o $@
.PHONY: install
install:
cp $(BLD)/$(APP) ./$(prefix)/bin/$(APP)
.PHONY: uninstall
uninstall:
-rm ./$(prefix)/bin/$(APP)
.PHONY: clean
clean:
-rm -f $(OBJ)/*.o
-rm -f $(BLD)/*.o
-rm -f $(BLD)/$(APP)*
.PHONY: help
help:
@echo ' all - build all'
@echo ' clean - remove all files from build dir'
@echo ' install - copy files to usr/local'
@echo ' dist - create distribution, tar.gz'
@echo ' $(APP) - build $(APP) executable'
@echo ' $(APP).o - build not link'
@echo ' $(APP)_test - build cppunit test'
@echo ' $(APP)_test.o - build cppunit test'
@echo ' scanrf - build scanrf executable'
@echo ' scanrf.o - build not link'
@echo ' scanrf_test - build cppunit test'
@echo ' scanrf_test.o - build cppunit test'