Browse code
fix makefile
Greg Wiley authored on 03/05/2017 16:35:45
Showing 9 changed files
Showing 9 changed files
- Makefile.in
- conversation_test.out
- dual_control_test.out
- logger_test.out
- request_test.out
- session_test.out
- token_test.out
- user_test.out
- validator_test.out
... | ... |
@@ -6,8 +6,13 @@ INTEGRATION_OBJS = sys_syslog.o sys_fstream.o sys_unistd.o sys_pwd.o sys_pam.o d |
6 | 6 |
OBJS = dual_control.o request.o validator.o conversation.o user.o token.o logger.o session.o |
7 | 7 |
TESTS = dual_control_test validator_test conversation_test request_test user_test token_test \ |
8 | 8 |
logger_test session_test |
9 |
-TESTOBJS = $(patsubst %,%.o,$(TESTS)) |
|
10 |
-SRCS := $(OBJS:.o=.cc) $(TESTOBJS:.o=.cc) |
|
9 |
+TEST_SOURCES := $(wildcard *_test.cc) |
|
10 |
+TESTS := $(patsubst %.cc,%.out,$(TEST_SOURCES)) |
|
11 |
+TESTRUNS := $(patsubst %.out,RUN_%,$(TESTS)) |
|
12 |
+FILES := $(SOURCES:.c=.x) |
|
13 |
+ |
|
14 |
+all: $(FILES) |
|
15 |
+SRCS := $(OBJS:.o=.cc) $(TEST_SOURCES) |
|
11 | 16 |
|
12 | 17 |
MODULELIB = pam_dual_control.so |
13 | 18 |
|
... | ... |
@@ -21,14 +26,14 @@ version: |
21 | 26 |
@echo COMPILER VERSION -------------------------------- |
22 | 27 |
$(CXX) --version |
23 | 28 |
|
24 |
-dual_control.a: $(OBJS) |
|
29 |
+dual_control.a: $(OBJS) $(INTEGRATION_OBJS) |
|
25 | 30 |
ar rvs $@ $^ |
26 | 31 |
ranlib $@ |
27 | 32 |
|
28 | 33 |
.PHONY: clean |
29 | 34 |
clean: |
30 | 35 |
@rm -f *.o *.a |
31 |
- @rm -f *_test |
|
36 |
+ @rm -f *.out |
|
32 | 37 |
@rm ./.depend |
33 | 38 |
|
34 | 39 |
.PHONY: distclean |
... | ... |
@@ -41,12 +46,14 @@ distclean: clean |
41 | 46 |
|
42 | 47 |
-include .depend |
43 | 48 |
|
44 |
-$(TESTS): %: %.o $(OBJS) |
|
45 |
- @$(CXX) $(CXXFLAGS) $(CPPFLAGS) -o $@ $^ |
|
46 |
- @./$@ |
|
49 |
+%_test.out: %_test.o $(OBJS) |
|
50 |
+ $(CXX) $(CXXFLAGS) $(CPPFLAGS) -o $@ $^ |
|
51 |
+ |
|
52 |
+$(TESTRUNS): $(TESTS) |
|
53 |
+ @./$< |
|
47 | 54 |
|
48 | 55 |
.PHONY: test |
49 |
-test: $(TESTS) |
|
56 |
+test: $(TESTRUNS) |
|
50 | 57 |
@echo Tests Passing |
51 | 58 |
|
52 | 59 |
.PHONY: install |