Added a test for the #include directive
This commit is contained in:
parent
c093d33a05
commit
11215a3861
2
Makefile
2
Makefile
|
@ -48,8 +48,10 @@ dist:
|
||||||
$(PACKAGE)-$(VERSION)/src/project.conf \
|
$(PACKAGE)-$(VERSION)/src/project.conf \
|
||||||
$(PACKAGE)-$(VERSION)/tests/define.cpp \
|
$(PACKAGE)-$(VERSION)/tests/define.cpp \
|
||||||
$(PACKAGE)-$(VERSION)/tests/if.cpp \
|
$(PACKAGE)-$(VERSION)/tests/if.cpp \
|
||||||
|
$(PACKAGE)-$(VERSION)/tests/include.cpp \
|
||||||
$(PACKAGE)-$(VERSION)/tests/Makefile \
|
$(PACKAGE)-$(VERSION)/tests/Makefile \
|
||||||
$(PACKAGE)-$(VERSION)/tests/cpp.sh \
|
$(PACKAGE)-$(VERSION)/tests/cpp.sh \
|
||||||
|
$(PACKAGE)-$(VERSION)/tests/include-define.cpp \
|
||||||
$(PACKAGE)-$(VERSION)/tests/project.conf \
|
$(PACKAGE)-$(VERSION)/tests/project.conf \
|
||||||
$(PACKAGE)-$(VERSION)/Makefile \
|
$(PACKAGE)-$(VERSION)/Makefile \
|
||||||
$(PACKAGE)-$(VERSION)/COPYING \
|
$(PACKAGE)-$(VERSION)/COPYING \
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
TARGETS = define.o if.o
|
TARGETS = define.o if.o include.o
|
||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
DESTDIR =
|
DESTDIR =
|
||||||
BINDIR = $(PREFIX)/bin
|
BINDIR = $(PREFIX)/bin
|
||||||
|
@ -19,14 +19,20 @@ define.o_CXXFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CXXFLAGS)
|
||||||
if.o_OBJS = if.o
|
if.o_OBJS = if.o
|
||||||
if.o_CXXFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CXXFLAGS)
|
if.o_CXXFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CXXFLAGS)
|
||||||
|
|
||||||
|
include.o_OBJS = include.o
|
||||||
|
include.o_CXXFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CXXFLAGS)
|
||||||
|
|
||||||
define.o: define.cpp cpp.sh
|
define.o: define.cpp cpp.sh
|
||||||
$(CXX) $(define.o_CXXFLAGS) -c define.cpp
|
$(CXX) $(define.o_CXXFLAGS) -c define.cpp
|
||||||
|
|
||||||
if.o: if.cpp cpp.sh
|
if.o: if.cpp cpp.sh
|
||||||
$(CXX) $(if.o_CXXFLAGS) -c if.cpp
|
$(CXX) $(if.o_CXXFLAGS) -c if.cpp
|
||||||
|
|
||||||
|
include.o: include.cpp cpp.sh
|
||||||
|
$(CXX) $(include.o_CXXFLAGS) -c include.cpp
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) -- $(define.o_OBJS) $(if.o_OBJS)
|
$(RM) -- $(define.o_OBJS) $(if.o_OBJS) $(include.o_OBJS)
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
$(RM) -- $(TARGETS)
|
$(RM) -- $(TARGETS)
|
||||||
|
|
1
tests/include-define.cpp
Normal file
1
tests/include-define.cpp
Normal file
|
@ -0,0 +1 @@
|
||||||
|
#define GOOD
|
6
tests/include.cpp
Normal file
6
tests/include.cpp
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
#include "include-define.cpp"
|
||||||
|
#ifdef GOOD
|
||||||
|
#warning good
|
||||||
|
#else
|
||||||
|
#error error
|
||||||
|
#endif
|
|
@ -1,11 +1,12 @@
|
||||||
targets=define.o,if.o
|
targets=define.o,if.o,include.o
|
||||||
cxx=./cpp.sh
|
cxx=./cpp.sh
|
||||||
cxxflags=
|
cxxflags=
|
||||||
dist=Makefile,cpp.sh
|
dist=Makefile,cpp.sh,include-define.cpp
|
||||||
|
|
||||||
[define.o]
|
[define.o]
|
||||||
type=object
|
type=object
|
||||||
sources=define.cpp
|
sources=define.cpp
|
||||||
|
depends=../src/cpp
|
||||||
|
|
||||||
[define.cpp]
|
[define.cpp]
|
||||||
depends=cpp.sh
|
depends=cpp.sh
|
||||||
|
@ -13,6 +14,15 @@ depends=cpp.sh
|
||||||
[if.o]
|
[if.o]
|
||||||
type=object
|
type=object
|
||||||
sources=if.cpp
|
sources=if.cpp
|
||||||
|
depends=../src/cpp
|
||||||
|
|
||||||
[if.cpp]
|
[if.cpp]
|
||||||
depends=cpp.sh
|
depends=cpp.sh
|
||||||
|
|
||||||
|
[include.o]
|
||||||
|
type=object
|
||||||
|
sources=include.cpp
|
||||||
|
depends=../src/cpp
|
||||||
|
|
||||||
|
[include.cpp]
|
||||||
|
depends=cpp.sh
|
||||||
|
|
Loading…
Reference in New Issue
Block a user