Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@

/generated
GNUmakefile
/.dub
/tests_extractor
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ dget | Internal | D source code downloader.
dman | Public | D documentation lookup tool.
dustmite | Public | [Test case minimization tool](https://github.com/CyberShadow/DustMite/wiki).
get_dlibcurl32 | Internal | Win32 libcurl downloader/converter.
has_public_example | Internal | Checks public functions for public examples (requires DUB)
rdmd | Public | [D build tool](http://dlang.org/rdmd.html).
rdmd_test | Internal | rdmd test suite.
tests_extractor | Internal | Extracts public unittests (requires DUB)
Expand All @@ -35,14 +34,16 @@ Running DUB tools
-----------------

Some tools require D's package manager DUB.
By default DUB builds a binary and executes it:
By default, DUB builds a binary and executes it. On a Posix system,
the source files can directly be executed with DUB (e.g. `./tests_extractor.d`).
Alternatively, the full single file execution command can be used:

```
dub --root styles -c has_public_example
dub --single tests_extractor.d
```

Remember that when programs are run via DUB, you need to pass in `--` before
the program's arguments, e.g `dub --root styles -c has_public_example -- -i ../phobos/std/algorithm`.
the program's arguments, e.g `dub --single tests_extractor.d -- -i ../phobos/std/algorithm`.

For more information, please see [DUB's documentation][dub-doc].

Expand Down
26 changes: 18 additions & 8 deletions posix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ CC = gcc
INSTALL_DIR = ../install
DRUNTIME_PATH = ../druntime
PHOBOS_PATH = ../phobos
DUB=dub

WITH_DOC = no
DOC = ../dlang.org
Expand All @@ -26,10 +27,10 @@ ifeq (,$(findstring win,$(OS)))
PHOBOSSO = $(PHOBOS_PATH)/generated/$(OS)/release/$(MODEL)/libphobos2.so
endif

# default include/link paths, override by setting DMD (e.g. make -f posix.mak DMD=dmd)
DMD += -I$(DRUNTIME_PATH)/import -I$(PHOBOS_PATH) -L-L$(PHOBOS_PATH)/generated/$(OS)/release/$(MODEL)

DFLAGS = -w
# default include/link paths, override by setting DFLAGS (e.g. make -f posix.mak DFLAGS=-I/foo)
DFLAGS = -I$(DRUNTIME_PATH)/import -I$(PHOBOS_PATH) \
-L-L$(PHOBOS_PATH)/generated/$(OS)/release/$(MODEL) $(MODEL_FLAG)
DFLAGS += -w

TOOLS = \
$(ROOT)/rdmd \
Expand Down Expand Up @@ -58,17 +59,17 @@ dman: $(ROOT)/dman
dustmite: $(ROOT)/dustmite

$(ROOT)/dustmite: DustMite/dustmite.d DustMite/splitter.d
$(DMD) $(MODEL_FLAG) $(DFLAGS) DustMite/dustmite.d DustMite/splitter.d -of$(@)
$(DMD) $(DFLAGS) DustMite/dustmite.d DustMite/splitter.d -of$(@)

#dreadful custom step because of libcurl dmd linking problem (Bugzilla 7044)
$(CURL_TOOLS): $(ROOT)/%: %.d
$(DMD) $(MODEL_FLAG) $(DFLAGS) -c -of$(@).o $(<)
$(DMD) $(DFLAGS) -c -of$(@).o $(<)
# grep for the linker invocation and append -lcurl
LINKCMD=$$($(DMD) $(MODEL_FLAG) $(DFLAGS) -v -of$(@) $(@).o 2>/dev/null | grep $(@).o); \
LINKCMD=$$($(DMD) $(DFLAGS) -v -of$(@) $(@).o 2>/dev/null | grep $(@).o); \
$${LINKCMD} -lcurl

$(TOOLS) $(DOC_TOOLS): $(ROOT)/%: %.d
$(DMD) $(MODEL_FLAG) $(DFLAGS) -of$(@) $(<)
$(DMD) $(DFLAGS) -of$(@) $(<)

ALL_OF_PHOBOS_DRUNTIME_AND_DLANG_ORG = # ???

Expand All @@ -85,6 +86,15 @@ install: $(TOOLS) $(CURL_TOOLS) $(ROOT)/dustmite
clean:
rm -f $(ROOT)/dustmite $(TOOLS) $(CURL_TOOLS) $(DOC_TOOLS) $(TAGS) *.o $(ROOT)/*.o

$(ROOT)/tests_extractor: tests_extractor.d
mkdir -p $(ROOT)
$(DUB) build \
--single $< --force --compiler=$(abspath $(DMD)) && mv ./tests_extractor $@

test: $(ROOT)/tests_extractor
$< -i ./test/tests_extractor/ascii.d | diff - ./test/tests_extractor/ascii.d.ext
$< -i ./test/tests_extractor/iteration.d | diff - ./test/tests_extractor/iteration.d.ext

ifeq ($(WITH_DOC),yes)
all install: $(DOC_TOOLS)
endif
Expand Down
4 changes: 0 additions & 4 deletions styles/.gitignore

This file was deleted.

16 changes: 0 additions & 16 deletions styles/dub.sdl

This file was deleted.

6 changes: 0 additions & 6 deletions styles/dub.selections.json

This file was deleted.

194 changes: 0 additions & 194 deletions styles/has_public_example.d

This file was deleted.

Loading