Skip to content

Commit

Permalink
make ddoc works now
Browse files Browse the repository at this point in the history
  • Loading branch information
Dav1dde committed Dec 5, 2011
1 parent 172fe0f commit 8ed621f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 21 deletions.
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ define make-lib
$(RANLIB) $(DLIB_PATH)/$@
endef

all: static-libs header doc
all: static-libs header doc ddoc

static-libs: $(LIBNAME_GL3N)

Expand All @@ -25,6 +25,9 @@ header: $(HEADERS)

doc: $(DOCUMENTATIONS)

ddoc:
$(DC) cutedoc.ddoc settings.ddoc modules.ddoc index.d $(DF)$(DOC_PATH)/index.html

geany-tag:
$(MKDIR) geany_config
geany -c geany_config -g $(PROJECT_NAME).d.tags $(SOURCES)
Expand All @@ -39,11 +42,11 @@ $(BUILD_PATH)/%.o : %.d

# Generate Header files
$(IMPORT_PATH)/%.di : %.d
$(DC) $(DFLAGS) $(DFLAGS_LINK) $(DFLAGS_IMPORT) -c -o- $< -Hf$@
$(DC) $(DFLAGS) $(DFLAGS_LINK) $(DFLAGS_IMPORT) -c -o- $< $(HF)$@

# Generate Documentation
$(DOC_PATH)/%.html : %.d
$(DC) $(DFLAGS) $(DFLAGS_LINK) $(DFLAGS_IMPORT) -c -o- $< -Df$@
$(DC) $(DFLAGS) $(DFLAGS_LINK) $(DFLAGS_IMPORT) -c -o- $< $(DF)$@

# For build shared lib need create shared object files
$(SONAME_GL3N): $(PICOBJECTS)
Expand All @@ -61,6 +64,7 @@ clean:
$(RM) $(LIBNAME_GL3N)
$(RM) $(HEADERS)
$(RM) $(DOCUMENTATIONS)
$(RM) $(DOC_PATH)/index.html

install:
$(MKDIR) $(LIB_DIR)
Expand Down
40 changes: 22 additions & 18 deletions command.make
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# define which operating system is used
ifdef SystemRoot
OS = "Windows"
STATIC_LIB_EXT = ".lib"
Expand Down Expand Up @@ -26,7 +25,7 @@ else
message = @(echo \033[31m $1 \033[0;0m1)
endif
endif

# Define command for copy, remove and create file/dir
ifeq ($(OS),"Windows")
RM = del /Q
Expand All @@ -41,7 +40,7 @@ else ifeq ($(OS),"Darwin")
CP = cp -fr
MKDIR = mkdir -p
endif

# If compiler is not define try to find it
ifndef DC
ifneq ($(strip $(shell which dmd 2>/dev/null)),)
Expand All @@ -54,18 +53,22 @@ ifndef DC
DC=gdc
endif
endif

# Define flag for gdc other
ifeq ($(DC),gdc)
DFLAGS = -O2 -fdeprecated
LINKERFLAG= -Xlinker
OUTPUT = -o
HF = -fintfc-file
DF = -fdoc-file
else
DFLAGS = -O -d
LINKERFLAG= -L
OUTPUT = -of
HF = -Hf
DF = -Df
endif

#define a suufix lib who inform is build with which compiler
ifeq ($(DC),gdc)
COMPILER=gdc
Expand All @@ -82,19 +85,19 @@ else ifeq ($(DC),dmd)
else ifeq ($(DC),dmd2)
COMPILER=dmd
endif

# Define relocation model for ldc or other
ifneq (,$(findstring ldc,$(DC)))
FPIC = -relocation-model=pic
else
FPIC = -fPIC
endif

# Add -ldl flag for linux
ifeq ($(OS),"Linux")
LDFLAGS += $(LINKERFLAG)-ldl
endif

# If model are not gieven take the same as current system
ARCH = $(shell arch || uname -m)
ifndef MODEL
Expand All @@ -104,16 +107,15 @@ ifndef MODEL
MODEL = 32
endif
endif

ifeq ($(MODEL), 64)
DFLAGS += -m64
LDFLAGS += -m64
else
DFLAGS += -m32
LDFLAGS += -m32
endif



# Define var PREFIX, LIB_DIR and INCLUDEDIR
ifndef PREFIX
ifeq ($(OS),"Windows")
Expand All @@ -125,7 +127,7 @@ ifndef PREFIX
endif
endif
ifndef LIB_DIR
ifeq ($(OS),"Windows")
ifeq ($(OS), "Windows")
LIB_DIR = $(PREFIX)\$(PROJECT_NAME)\lib
else ifeq ($(OS), "Linux")
LIB_DIR = $(PREFIX)/lib
Expand All @@ -142,27 +144,27 @@ ifndef INCLUDE_DIR
INCLUDE_DIR = $(PREFIX)/include/d/$(PROJECT_NAME)
endif
endif

ifndef CC
CC = gcc
endif

DLIB_PATH = ./lib
IMPORT_PATH = ./import
DOC_PATH = ./doc
BUILD_PATH = ./build

DFLAGS_IMPORT = -I"gl3n"
DFLAGS_LINK = $(LDFLAGS)

LIBNAME_GL3N = lib$(PROJECT_NAME)-$(COMPILER)$(STATIC_LIB_EXT)
SONAME_GL3N = lib$(PROJECT_NAME)$(DYNAMIC_LIB_EXT)

MAKE = make
AR = ar
ARFLAGS = rcs
RANLIB = ranlib

export CC
export OS
export STATIC_LIB_EXT
Expand All @@ -176,6 +178,8 @@ export MODEL
export FPIC
export LINKERFLAG
export OUTPUT
export DF
export HF
export PREFIX
export LIB_DIR
export INCLUDE_DIR
Expand Down

0 comments on commit 8ed621f

Please sign in to comment.