Skip to content

Commit

Permalink
fixed automatic dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
EmielBruijntjes committed Mar 30, 2016
1 parent c424358 commit f3c8ce9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.d
*.o
*.so
*.a
Expand Down
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ ARCHIVER = ar rcs
# production servers).
#

COMPILER_FLAGS = -Wall -c -I. -O2 -pipe -std=c++11 -Wno-sign-compare -Wno-psabi
COMPILER_FLAGS = -Wall -c -I. -O2 -MD -pipe -std=c++11 -Wno-sign-compare -Wno-psabi
SHARED_COMPILER_FLAGS = -fPIC
STATIC_COMPILER_FLAGS =
LINKER_FLAGS = -L.
DEPENDENCIES = -ljitplus -ljit -ldl -lboost_regex
LIBRARIES = -ljitplus -ljit -ldl -lboost_regex
FLEX_FLAGS =
LEMON_FLAGS =

Expand Down Expand Up @@ -128,6 +128,12 @@ SHARED_LIBRARY_OBJECTS = $(sort $(LIBRARY_SOURCES:%.cpp=%.o))
STATIC_LIBRARY_OBJECTS = $(sort $(LIBRARY_SOURCES:%.cpp=%.s.o))
PROGRAM_OBJECTS = $(sort $(PROGRAM_SOURCES:%.cpp=%.o))

#
# Dependency (*.d) files
#

DEPENDENCIES = $(LIBRARY_SOURCES:%.cpp=%.d) $(PROGRAM_SOURCES:%.cpp=%.d)

#
# Auto-generated files
#
Expand All @@ -145,8 +151,10 @@ GENERATED = ${TOKENIZER} ${PARSER} ${PARSER:%.cpp=%.h} ${PARSER:%.cpp=%.

all: ${SHARED_LIBRARY} ${STATIC_LIBRARY} ${PROGRAM}

-include ${DEPENDENCIES}

${SHARED_LIBRARY}: ${PARSER} ${TOKENIZER} ${SHARED_LIBRARY_OBJECTS}
${LINKER} ${LINKER_FLAGS} -Wl,-soname,libsmarttpl.so.${SONAME} -shared -o $@ ${SHARED_LIBRARY_OBJECTS} ${DEPENDENCIES}
${LINKER} ${LINKER_FLAGS} -Wl,-soname,libsmarttpl.so.${SONAME} -shared -o $@ ${SHARED_LIBRARY_OBJECTS} ${LIBRARIES}

${STATIC_LIBRARY}: ${PARSER} ${TOKENIZER} ${STATIC_LIBRARY_OBJECTS}
${ARCHIVER} ${STATIC_LIBRARY} ${STATIC_LIBRARY_OBJECTS}
Expand Down

0 comments on commit f3c8ce9

Please sign in to comment.