Jump to content

  • Log In with Google      Sign In   
  • Create Account


Edgar Reynaldo

Member Since 16 Apr 2011
Offline Last Active May 13 2013 11:43 AM

Topics I've Started

Programming and depression research

10 May 2013 - 03:43 PM

Hello fellow game devs! I am currently conducting a research project for my psych class. I am in need of volunteers to help with my research.

All you need to do is to take this short depression screening and answer the question of how many hours you have generally spent programming in an average week over the last 6 months or so.

The screening is self scored, and is called Beck's Depression Inventory.
 

Beck's Depression Inventory

This depression inventory can be self-scored. The scoring scale is at the end of the questionnaire.

1.
	0 I do not feel sad.
	1 I feel sad 
	2 I am sad all the time and I can't snap out of it. 
	3 I am so sad and unhappy that I can't stand it.
2.
	0 I am not particularly discouraged about the future. 
	1 I feel discouraged about the future. 
	2 I feel I have nothing to look forward to. 
	3 I feel the future is hopeless and that things cannot improve.
3.
	0 I do not feel like a failure. 
	1 I feel I have failed more than the average person. 
	2 As I look back on my life, all I can see is a lot of failures. 
	3 I feel I am a complete failure as a person.
4. 
	0 I get as much satisfaction out of things as I used to. 
	1 I don't enjoy things the way I used to. 
	2 I don't get real satisfaction out of anything anymore. 
	3 I am dissatisfied or bored with everything.
5. 
	0 I don't feel particularly guilty 
	1 I feel guilty a good part of the time. 
	2 I feel quite guilty most of the time. 
	3 I feel guilty all of the time.
6. 
	0 I don't feel I am being punished. 
	1 I feel I may be punished. 
	2 I expect to be punished. 
	3 I feel I am being punished.
7. 
	0 I don't feel disappointed in myself. 
	1 I am disappointed in myself. 
	2 I am disgusted with myself. 
	3 I hate myself.
8. 
	0 I don't feel I am any worse than anybody else. 
	1 I am critical of myself for my weaknesses or mistakes. 
	2 I blame myself all the time for my faults. 
	3 I blame myself for everything bad that happens.
9. 
	0 I don't have any thoughts of killing myself. 
	1 I have thoughts of killing myself, but I would not carry them out. 
	2 I would like to kill myself. 
	3 I would kill myself if I had the chance.
10. 
	0 I don't cry any more than usual. 
	1 I cry more now than I used to. 
	2 I cry all the time now. 
	3 I used to be able to cry, but now I can't cry even though I want to.
11. 
	0 I am no more irritated by things than I ever was. 
	1 I am slightly more irritated now than usual. 
	2 I am quite annoyed or irritated a good deal of the time. 
	3 I feel irritated all the time.
12. 
	0 I have not lost interest in other people. 
	1 I am less interested in other people than I used to be. 
	2 I have lost most of my interest in other people. 
	3 I have lost all of my interest in other people.
13. 
	0 I make decisions about as well as I ever could. 
	1 I put off making decisions more than I used to. 
	2 I have greater difficulty in making decisions more than I used to. 
	3 I can't make decisions at all anymore.
14. 
	0 I don't feel that I look any worse than I used to. 
	1 I am worried that I am looking old or unattractive. 
	2 I feel there are permanent changes in my appearance that make me look unattractive 
	3 I believe that I look ugly.
15. 
	0 I can work about as well as before. 
	1 It takes an extra effort to get started at doing something. 
	2 I have to push myself very hard to do anything. 
	3 I can't do any work at all.
16. 
	0 I can sleep as well as usual. 
	1 I don't sleep as well as I used to. 
	2 I wake up 1-2 hours earlier than usual and find it hard to get back to sleep. 
	3 I wake up several hours earlier than I used to and cannot get back to sleep.
17. 
	0 I don't get more tired than usual. 
	1 I get tired more easily than I used to. 
	2 I get tired from doing almost anything. 
	3 I am too tired to do anything.
18. 
	0 My appetite is no worse than usual. 
	1 My appetite is not as good as it used to be. 
	2 My appetite is much worse now. 
	3 I have no appetite at all anymore.
19. 
	0 I haven't lost much weight, if any, lately. 
	1 I have lost more than five pounds. 
	2 I have lost more than ten pounds. 
	3 I have lost more than fifteen pounds.
20. 
	0 I am no more worried about my health than usual. 
	1 I am worried about physical problems like aches, pains, upset stomach, or constipation. 
	2 I am very worried about physical problems and it's hard to think of much else. 
	3 I am so worried about my physical problems that I cannot think of anything else.
21. 
	0 I have not noticed any recent change in my interest in sex. 
	1 I am less interested in sex than I used to be. 
	2 I have almost no interest in sex. 
	3 I have lost interest in sex completely.

INTERPRETING THE BECK DEPRESSION INVENTORY
Now that you have completed the questionnaire, add up the score for each of the twenty-one questions by counting the number to the right of each question you marked. The highest possible total for the whole test would be sixty-three. This would mean you circled number three on all twenty-one questions. Since the lowest possible score for each question is zero, the lowest possible score for the test would be zero. This would mean you circles zero on each question. You can evaluate your depression according to the Table below.

Total Score____________________Levels of Depression

1-10____________________These ups and downs are considered normal 
11-16___________________ Mild mood disturbance 
17-20___________________Borderline clinical depression 
21-30___________________Moderate depression 
31-40___________________Severe depression 
over 40__________________Extreme depression

A PERSISTENT SCORE OF 17 OR ABOVE INDICATES THAT YOU MAY NEED MEDICAL TREATMENT.



 


If you are uncomfortable sharing the results publicly, please PM me your results, and if not, please post them here so I can record them.

My scores :
BDI - 18
Average hrs spent programming per week over last 6 months - 10

I most definitely appreciate you guys taking the time to help me out. ;)
Edgar

There are no right or wrong answers, please be as honest as possible. With me, and yourself. If you feel you may have depression, I encourage you to explore treatment options with your doctor and your psychiatrist. I've never been diagnosed explicitly with depression, but I know I have trouble being happy, and I am currently on Buproprion to help with it. Depression is entirely treatable. Don't suffer for no reason. Seek treatment if you need it.

 


SantaHack 2011

11 December 2011 - 08:40 PM

Instead of the traditional ChristmasHack held by Jakub Wasilewski, this year at http://www.allegro.cc, we are hosting SantaHack 2011. The basic idea is to create a wishlist, vote on other peoples wishlists, spend a week making a game for someone else, and receive one in return. The use of Allegro 4 or 5 is NOT required. To register for the compo, you need to register at the allegro.cc forums.

Relevant links :
https://www.allegro.cc/account/join (Create a free account at allegro.cc)
http://www.allegro.c...s/thread/609036 (SantaHack 2011 thread at a.cc)
http://www.allegro.c...s/thread/608970 (ChristmasHack this year? thread at a.cc)
http://www.santahack.net/home (SantaHack website)
http://www.santahack.net/rules (SantaHack rules)


Important Dates
  • Registration phase begins December 12, 2011 at 12:00 UTC.
  • Wishlist voting phase begins December 15, 2011 at 12:00 UTC and ends December 17, 2011 at 10:00 UTC.
  • Development phase begins December 17, 2011 at 12:00 UTC.
  • All entries are due by December 24, 2011 at 12:00 UTC.
  • Entries are released to recipients on December 25, 2011 at 0:00 UTC.
  • All entries are publicly released on December 26, 2011 at 12:00 UTC.

makefile always builds everything - why?

11 November 2011 - 07:00 PM

SOLVED : See solution below

I can't get the makefile for my software library Eagle to only build the files that are out of date. Can anyone see why this makefile always builds everything? Does it have anything to do with implicit rules?

It should only rebuild the .d files when the source files or their dependencies are newer than they are.
It should only rebuild the object files when the .d files or their .c or .cpp file dependencies are newer than they are.
It should only rebuild the libraries when the object files are newer than they are.

However, it rebuilds all the .d files, all the .o files, and the library every time I run make and I don't understand why.

Any makefile gurus out there who can help me?

If you want to try building the library yourself, you can download the latest SVN code from sourceforge :
svn checkout "http://svn.code.sf.net/p/eaglegui/code/trunk eaglegui-code"

Here's the current makefile :
#/*
# *
# * 	_______   	___   	____  	__   	_______
# *	/\  ____\	/|   \ 	/  __\	/\ \ 	/\  ____\
# *	\ \ \___/_   ||  _ \   |  /__/____\ \ \	\ \ \___/_
# * 	\ \  ____\  || |_\ \  |\ \ /\_  _\\ \ \	\ \  ____\
# *  	\ \ \___/_ ||  ___ \ \ \ \\//\ \/ \ \ \____\ \ \___/_
# *   	\ \______\||_|__/\_\ \ \ \_\/ |   \ \_____\\ \______\
# *    	\/______/|/_/  \/_/  \_\_____/	\/_____/ \/______/
# *
# *
# *	EAGLE
# *	Edgar's Allegro Gui Library and Extensions
# *
# *	Copyright 2009-2011 by Edgar Reynaldo
# *
# *	See EagleLicense.txt for allowed uses of this library.
# *
# */

# Must include makefile.version before makefile.platform!
include makefile.version

# Platform specific shiznit goes here
# makefile.platform is generated by fix.*

include makefile.platform



ifndef STATICLINK
   DYNAMICLINK = 1
endif

ifndef DEBUGMODE
   ifndef PROFILEMODE
  	RELEASEMODE = 1
   endif
else
   PROFILEMODE=
   RELEASEMODE=
endif

ifndef PROFILEMODE
   ifndef DEBUGMODE
  	RELEASEMODE = 1
   endif
else
   DEBUGMODE=
   RELEASEMODE=
endif

ifndef BUILDDIR
   BUILDDIR = testbuild
endif

WFLAGS = -Wall -Wshadow
CC = g++

ifeq (WINDOWS,$(PLATFORM))
   LIBALLEGROPROFILE := -lalleg44-profile.dll
   LIBALLEGRODEBUG := -lalleg44-debug.dll
   LIBALLEGRORELEASE := -lalleg44.dll
endif
ifeq (NIX,$(PLATFORM))
   LIBALLEGROPROFILE := -lalleg-profile
   LIBALLEGRODEBUG := -lalleg-debug
   LIBALLEGRORELEASE := -lalleg
endif

ifdef STATICLINK
   ifdef PROFILEMODE
  	OBJDIR := $(BUILDDIR)/obj/Static/Profiling
  	LIBSUFFIX := _ps
  	CFLAGS := -pg
  	LFLAGS := -pg $(GMON)
  	MODE := Static Profiling mode
   endif
   ifdef DEBUGMODE
  	OBJDIR := $(BUILDDIR)/obj/Static/Debug
  	LIBSUFFIX := _ds
  	CFLAGS := -g -DDEBUGMODE -DEAGLE_ASSERT_EXCEPTION
  	LFLAGS :=
  	MODE := Static Debugging mode
   endif
   ifdef RELEASEMODE
  	OBJDIR := $(BUILDDIR)/obj/Static/Release
  	LIBSUFFIX := _rs
  	CFLAGS := -O2
  	LFLAGS :=
  	MODE := Static Release mode
   endif
   CFLAGS := $(CFLAGS) -c -DALLEGRO_STATICLINK
endif
ifdef DYNAMICLINK
   ifdef PROFILEMODE
  	OBJDIR := $(BUILDDIR)/obj/Dynamic/Profiling
  	LIBSUFFIX := _p
  	CFLAGS := -pg
  	LFLAGS := -pg $(GMON) $(LIBALLEGROPROFILE)
  	MODE := Dynamic Profiling mode
   endif
   ifdef DEBUGMODE
  	OBJDIR := $(BUILDDIR)/obj/Dynamic/Debug
  	LIBSUFFIX := _d
  	CFLAGS := -g -DDEBUGMODE -DEAGLE_ASSERT_EXCEPTION
  	LFLAGS := $(LIBALLEGRODEBUG)
  	MODE := Dynamic Debugging mode
   endif
   ifdef RELEASEMODE
  	OBJDIR := $(BUILDDIR)/obj/Dynamic/Release
  	LIBSUFFIX := _r
  	CFLAGS := -O2
  	LFLAGS := $(LIBALLEGRORELEASE) -s
  	MODE := Dynamic Release mode
   endif
   CFLAGS := $(CFLAGS) -c
   CFLAGS := $(CFLAGS) $(EXTRACFLAGS)
endif

COMPILEFLAGS = $(WFLAGS) $(CFLAGS)
LINKFLAGS = $(LFLAGS)

CPPSRCS = $(notdir $(wildcard src/*.cpp))
CSRCS = $(notdir $(wildcard src/*.c))
CPPGUISRCS = $(notdir $(wildcard src/GuiCode/*.cpp))
CGUISRCS = $(notdir $(wildcard src/GuiCode/*.c))

CPPOBJS = $(addsuffix .o , $(basename $(CPPSRCS)))
COBJS = $(addsuffix .o , $(basename $(CSRCS)))
CPPGUIOBJS = $(addsuffix .o , $(basename $(CPPGUISRCS)))
CGUIOBJS = $(addsuffix .o , $(basename $(CGUISRCS)))

CPPOBJS := $(addprefix $(OBJDIR)/,$(CPPOBJS))
COBJS := $(addprefix $(OBJDIR)/,$(COBJS))
CPPGUIOBJS := $(addprefix $(OBJDIR)/,$(CPPGUIOBJS))
CGUIOBJS := $(addprefix $(OBJDIR)/,$(CGUIOBJS))

CPPSRCS := $(addprefix src/,$(CPPSRCS))
CSRCS := $(addprefix src/,$(CSRCS))
CPPGUISRCS := $(addprefix src/GuiCode/,$(CPPGUISRCS))
CGUISRCS := $(addprefix src/GuiCode/,$(CGUISRCS))

ALLCSRCS := $(CSRCS) $(CGUISRCS)
ALLCPPSRCS := $(CPPSRCS) $(CPPGUISRCS)
ALLSRCS := $(ALLCSRCS) $(ALLCPPSRCS)

ALLCOBJS := $(COBJS) $(CGUIOBJS)
ALLCPPOBJS := $(CPPOBJS) $(CPPGUIOBJS)
ALLOBJS := $(ALLCOBJS) $(ALLCPPOBJS)

$(warning Including *.d files...)
include $(ALLOBJS:%.c:$(OBJDIR)$(SLASH)%.d)
include $(ALLOBJS:%.cpp:$(OBJDIR)$(SLASH)%.d)

#CHDRS = $(notdir $(wildcard include/*.h))
#CPPHDRS = $(notdir $(wildcard include/*.hpp))
#CGUIHDRS = $(notdir $(wildcard include/GuiCode/*.h))
#CPPGUIHDRS = $(notdir $(wildcard include/GuiCode/*.hpp))

EAGLEHDR = include/Eagle.hpp
CHDRS = $(wildcard include/Eagle/*.h)
CPPHDRS = $(wildcard include/Eagle/*.hpp)
CGUIHDRS = $(wildcard include/Eagle/GuiCode/*.h)
CPPGUIHDRS = $(wildcard include/Eagle/GuiCode/*.hpp)

HDRS := $(CHDRS) $(CPPHDRS)
GUIHDRS := $(CGUIHDRS) $(CPPGUIHDRS)
ALLHDRS := $(EAGLEHDR) $(HDRS) $(GUIHDRS)

LIBDIR := $(BUILDDIR)$(SLASH)lib
LIBNAME = eagle
# eagle_*
FULLLIBNAME := $(LIBNAME)$(LIBSUFFIX)

# WIN = eagle_*.dll	NIX = eagle_*.so.1
DLLNAME := $(FULLLIBNAME)$(SHAREDLIBEXT)

#soname = dll , -o = .a
#static libs on *NIX are .a files

ifdef STATICLINK
   # libeagle_*.a
   ARCHIVENAME := lib$(FULLLIBNAME).a
else
   # libeagle_*.so on unix , libeagle_*.dll.a on MinGW
   ifeq (WINDOWS,$(PLATFORM))
  	# WIN = libeagle_*.dll.a
  	ARCHIVENAME := lib$(DLLNAME).a
   endif
   ifeq (NIX,$(PLATFORM))
  	# NIX libeagle_*.so
  	ARCHIVENAME := lib$(FULLLIBNAME).so
  	SONAME = $(ARCHIVENAME).$(MAJORVERSION).$(MINORVERSION)
  	DLLNAME := lib$(DLLNAME).$(FULLVERSION)
   endif
endif

BINDIR = $(INSTALLDIR)$(SLASH)bin

OUTPUTLIB := $(LIBDIR)$(SLASH)$(ARCHIVENAME)
OUTPUTDLL := $(LIBDIR)$(SLASH)$(DLLNAME)

#fake :
ifeq (WINDOWS,$(PLATFORM))
#	$(ECHO) Platform is WINDOWS!
   OUTPUTDEF = $(LIBDIR)$(SLASH)$(DLLNAME).def
   CREATEDEF = -Wl,--output-def=$(OUTPUTDEF)
   CREATEIMPLIB = -Wl,--out-implib=$(OUTPUTLIB)
   MAKEDLL = -Wl,--dll
endif
ifeq (NIX,$(PLATFORM))
#	$(ECHO) Platform is NIX!
   CREATEIMPLIB = -Wl,-soname,$(SONAME)
endif





# Targets begin here



#$(OUTPUTLIB) $(OUTPUTDLL) $(OUTPUTDEF) : $(ALLOBJS)
#	$(ECHO) Building lib $(OUTPUTLIB) in $(MODE)
#ifdef STATICLINK
#	$(TEST) ar.exe -rcs $(OUTPUTLIB) $(ALLOBJS)
#endif
#ifdef DYNAMICLINK
# mingw32-g++.exe -shared -Wl,--output-def=build\lib\libeagle_r.dll.def -Wl,--out-implib=build\lib\libeagle_r.dll.a -Wl,--dll
#	$(TEST) $(CC) -shared -Wl,--output-def=$(OUTPUTDEF)  -Wl,--out-implib=$(OUTPUTLIB) -Wl,--dll $(ALLOBJS) -o $(OUTPUTDLL)  $(LINKFLAGS)
#endif


ifdef STATICLINK
   $(OUTPUTLIB)  : $(ALLOBJS)
	$(ECHO) Building lib $(OUTPUTLIB) in $(MODE)
	$(TEST) ar.exe -rcs $(OUTPUTLIB) $(ALLOBJS)
endif
ifdef DYNAMICLINK
   $(OUTPUTLIB) $(OUTPUTDLL) $(OUTPUTDEF) : $(ALLOBJS)
# Windows
# mingw32-g++.exe -shared -Wl,--output-def=build\lib\libeagle_r.dll.def -Wl,--out-implib=build\lib\libeagle_r.dll.a -Wl,--dll
# *NIX
# g++ -shared -Wl,-soname,libprint.so.1 -o libprint.so.1.0 $(OBJS)
	$(ECHO) Building lib $(OUTPUTLIB) in $(MODE)
	$(TEST) $(CC) -shared $(CREATEDEF) $(CREATEIMPLIB) $(MAKEDLL) $(ALLOBJS) -o $(OUTPUTDLL) $(LINKFLAGS)
endif

$(FIXDFILES) : Fixdfiles.cpp
	$(CC) -Wall -O2 -o $(FIXDFILES) Fixdfiles.cpp
ifeq (NIX,$(PLATFORM))
	chmod +x $(FIXDFILES)
endif

.PRECIOUS : $(OBJDIR)/%.d

$(OBJDIR)/%.d : src/%.c makebuilddirs $(FIXDFILES)
	$(TEST) $(CC) -MM $< -Iinclude > $@
#	$(FIXDFILES) $(OBJDIR) $(@F) > $@
	$(FIXDFILES) $(OBJDIR) $(@F)

$(OBJDIR)/%.d : src/%.cpp makebuilddirs $(FIXDFILES)
	$(TEST) $(CC) -MM $< -Iinclude > $@
#	$(FIXDFILES) $(OBJDIR) $(@F) > $@
	$(FIXDFILES) $(OBJDIR) $(@F)

$(OBJDIR)/%.d : src/GuiCode/%.c makebuilddirs $(FIXDFILES)
	$(TEST) $(CC) -MM $< -Iinclude > $@
#	$(FIXDFILES) $(OBJDIR) $(@F) > $@
	$(FIXDFILES) $(OBJDIR) $(@F)

$(OBJDIR)/%.d : src/GuiCode/%.cpp makebuilddirs $(FIXDFILES)
	$(TEST) $(CC) -MM $< -Iinclude > $@
#	$(FIXDFILES) $(OBJDIR) $(@F) > $@
	$(FIXDFILES) $(OBJDIR) $(@F)

#$(warning Including d files!)
#include $(COBJS:%.o:%.d)
#include $(CPPOBJS:%.o:%.d)
#include $(CGUIOBJS:%.o:%.d)
#include $(CPPGUIOBJS:%.o:%.d)

$(OBJDIR)/%.o : src/%.c $(OBJDIR)/%.d
	$(TEST) $(CC) $(COMPILEFLAGS) -Iinclude -o $@ $<

$(OBJDIR)/%.o : src/%.cpp $(OBJDIR)/%.d
	$(TEST) $(CC) $(COMPILEFLAGS) -Iinclude -o $<

$(OBJDIR)/%.o : src/GuiCode/%.c $(OBJDIR)/%.d
	$(TEST) $(CC) $(COMPILEFLAGS) -Iinclude -o $@ $<

$(OBJDIR)/%.o : src/GuiCode/%.cpp $(OBJDIR)/%.d
	$(TEST) $(CC) $(COMPILEFLAGS) -Iinclude -o $@ $<

.PHONY : makefile.platform
makefile.platform :
ifeq (,$(findstring makefile.platform,$(wildcard makefile.platform)))
	$(error Please run fix.bat for Windows or ./fix.sh for *nix to generate makefile.platform)
endif

makebuilddirs :
	-$(MKDIR) $(LIBDIR)
	-$(MKDIR) $(subst /,$(SLASH),$(OBJDIR))

makeinstalldirs :
	-$(MKDIR) $(BINDIR)
	-$(MKDIR) $(INSTALLDIR)$(SLASH)lib
#	-$(MKDIR) $(INSTALLDIR)$(SLASH)include
#	-$(MKDIR) $(INSTALLDIR)$(SLASH)include$(SLASH)Eagle
# This should take care of creating include and Eagle as well
	-$(MKDIR) $(INSTALLDIR)$(SLASH)include$(SLASH)Eagle$(SLASH)GuiCode

all :
	$(MAKE) DEBUGMODE=1
	$(MAKE) PROFILEMODE=1
	$(MAKE)
	$(MAKE) DEBUGMODE=1 STATICLINK=1
	$(MAKE) PROFILEMODE=1 STATICLINK=1
	$(MAKE) STATICLINK=1


install : $(OUTPUTLIB) $(OUTPUTDLL) $(OUTPUTDEF) makeinstalldirs installheaders
ifeq (WINDOWS,$(PLATFORM))
	$(COPY) $(OUTPUTDLL) $(INSTALLDIR)$(SLASH)bin
	$(COPY) $(OUTPUTLIB) $(INSTALLDIR)$(SLASH)lib
endif
ifeq (NIX,$(PLATFORM))
	$(COPY) $(OUTPUTDLL) $(INSTALLDIR)$(SLASH)lib
	ln -sf $(INSTALLDIR)$(SLASH)lib$(SLASH)$(DLLNAME) $(INSTALLDIR)$(SLASH)lib$(SLASH)$(SONAME)
	ln -sf $(INSTALLDIR)$(SLASH)lib$(SLASH)$(SONAME) $(INSTALLDIR)$(SLASH)lib$(SLASH)$(ARCHIVEAME)
endif

installheaders : $(ALLHDRS)
	$(COPY) include$(SLASH)Eagle$(SLASH)*.* $(INSTALLDIR)$(SLASH)include$(SLASH)Eagle
	$(COPY) include$(SLASH)Eagle$(SLASH)GuiCode$(SLASH)*.* $(INSTALLDIR)$(SLASH)include$(SLASH)Eagle$(SLASH)GuiCode
	$(COPY) include$(SLASH)Eagle.hpp $(INSTALLDIR)$(SLASH)include

uninstall :
	-$(REMOVE) $(INSTALLDIR)$(SLASH)bin$(SLASH)$(DLLNAME)
	-$(REMOVE) $(INSTALLDIR)$(SLASH)lib$(SLASH)$(ARCHIVENAME)
	-$(REMDIR) $(INSTALLDIR)$(SLASH)include$(SLASH)Eagle
	-$(REMOVE) $(INSTALLDIR)$(SLASH)include$(SLASH)Eagle.hpp

installall : all
	$(MAKE) DEBUGMODE=1 install INSTALLDIR=$(INSTALLDIR)
	$(MAKE) PROFILEMODE=1 install INSTALLDIR=$(INSTALLDIR)
	$(MAKE) install INSTALLDIR=$(INSTALLDIR)
	$(MAKE) DEBUGMODE=1 STATICLINK=1 install INSTALLDIR=$(INSTALLDIR)
	$(MAKE) PROFILEMODE=1 STATICLINK=1 install INSTALLDIR=$(INSTALLDIR)
	$(MAKE) STATICLINK=1 install INSTALLDIR=$(INSTALLDIR)

uninstallall :
	$(MAKE) DEBUGMODE=1 uninstall INSTALLDIR=$(INSTALLDIR)
	$(MAKE) PROFILEMODE=1 uninstall INSTALLDIR=$(INSTALLDIR)
	$(MAKE) uninstall INSTALLDIR=$(INSTALLDIR)
	$(MAKE) DEBUGMODE=1 STATICLINK=1 uninstall INSTALLDIR=$(INSTALLDIR)
	$(MAKE) PROFILEMODE=1 STATICLINK=1 uninstall INSTALLDIR=$(INSTALLDIR)
	$(MAKE) STATICLINK=1 uninstall INSTALLDIR=$(INSTALLDIR)

.PHONY : clean cleanobj cleanlib

clean : cleanobj cleanlib

cleanobj :
	$(REMOVE) $(subst /,$(SLASH),$(OBJDIR))$(SLASH)*.*

cleanlib :
	$(REMOVE) $(subst /,$(SLASH),$(OUTPUTLIB))

cleanall :
	$(MAKE) DEBUGMODE=1 clean
	$(MAKE) PROFILEMODE=1 clean
	$(MAKE) clean
	$(MAKE) DEBUGMODE=1 STATICLINK=1 clean
	$(MAKE) PROFILEMODE=1 STATICLINK=1 clean
	$(MAKE) STATICLINK=1 clean

help :
	$(ECHO) Available options : (Default build is dynamic release mode)
	$(ECHO) DEBUGMODE=1
	$(ECHO) PROFILEMODE=1
	$(ECHO) STATICLINK=1
	$(ECHO) on
	$(ECHO) Available targets : (Default target is dynamic release library)
	$(ECHO) all
	$(ECHO) install
	$(ECHO) uninstall
	$(ECHO) installall
	$(ECHO) uninstallall
	$(ECHO) clean
	$(ECHO) cleanall
	$(ECHO) on
	$(ECHO) Default installation directory is $MINGDIR$ for Windows and /usr for *nix
	$(ECHO) Set using INSTALLDIR=install/directory/path


The rules for building the *.d and *.o and the *.dll / *.so / *.a files are here :
# Targets begin here



#$(OUTPUTLIB) $(OUTPUTDLL) $(OUTPUTDEF) : $(ALLOBJS)
#	$(ECHO) Building lib $(OUTPUTLIB) in $(MODE)
#ifdef STATICLINK
#	$(TEST) ar.exe -rcs $(OUTPUTLIB) $(ALLOBJS)
#endif
#ifdef DYNAMICLINK
# mingw32-g++.exe -shared -Wl,--output-def=build\lib\libeagle_r.dll.def -Wl,--out-implib=build\lib\libeagle_r.dll.a -Wl,--dll
#	$(TEST) $(CC) -shared -Wl,--output-def=$(OUTPUTDEF)  -Wl,--out-implib=$(OUTPUTLIB) -Wl,--dll $(ALLOBJS) -o $(OUTPUTDLL)  $(LINKFLAGS)
#endif


ifdef STATICLINK
   $(OUTPUTLIB)  : $(ALLOBJS)
	$(ECHO) Building lib $(OUTPUTLIB) in $(MODE)
	$(TEST) ar.exe -rcs $(OUTPUTLIB) $(ALLOBJS)
endif
ifdef DYNAMICLINK
   $(OUTPUTLIB) $(OUTPUTDLL) $(OUTPUTDEF) : $(ALLOBJS)
# Windows
# mingw32-g++.exe -shared -Wl,--output-def=build\lib\libeagle_r.dll.def -Wl,--out-implib=build\lib\libeagle_r.dll.a -Wl,--dll
# *NIX
# g++ -shared -Wl,-soname,libprint.so.1 -o libprint.so.1.0 $(OBJS)
	$(ECHO) Building lib $(OUTPUTLIB) in $(MODE)
	$(TEST) $(CC) -shared $(CREATEDEF) $(CREATEIMPLIB) $(MAKEDLL) $(ALLOBJS) -o $(OUTPUTDLL) $(LINKFLAGS)
endif

$(FIXDFILES) : Fixdfiles.cpp
	$(CC) -Wall -O2 -o $(FIXDFILES) Fixdfiles.cpp
ifeq (NIX,$(PLATFORM))
	chmod +x $(FIXDFILES)
endif

.PRECIOUS : $(OBJDIR)/%.d

$(OBJDIR)/%.d : src/%.c makebuilddirs $(FIXDFILES)
	$(TEST) $(CC) -MM $< -Iinclude > $@
#	$(FIXDFILES) $(OBJDIR) $(@F) > $@
	$(FIXDFILES) $(OBJDIR) $(@F)

$(OBJDIR)/%.d : src/%.cpp makebuilddirs $(FIXDFILES)
	$(TEST) $(CC) -MM $< -Iinclude > $@
#	$(FIXDFILES) $(OBJDIR) $(@F) > $@
	$(FIXDFILES) $(OBJDIR) $(@F)

$(OBJDIR)/%.d : src/GuiCode/%.c makebuilddirs $(FIXDFILES)
	$(TEST) $(CC) -MM $<  -Iinclude > $@
#	$(FIXDFILES) $(OBJDIR) $(@F) > $@
	$(FIXDFILES) $(OBJDIR) $(@F)

$(OBJDIR)/%.d : src/GuiCode/%.cpp makebuilddirs $(FIXDFILES)
	$(TEST) $(CC) -MM $< -Iinclude > $@
#	$(FIXDFILES) $(OBJDIR) $(@F) > $@
	$(FIXDFILES) $(OBJDIR) $(@F)

#$(warning Including d files!)
#include $(COBJS:%.o:%.d)
#include $(CPPOBJS:%.o:%.d)
#include $(CGUIOBJS:%.o:%.d)
#include $(CPPGUIOBJS:%.o:%.d)

$(OBJDIR)/%.o : src/%.c $(OBJDIR)/%.d
	$(TEST) $(CC) $(COMPILEFLAGS) -Iinclude -o $@ $<

$(OBJDIR)/%.o : src/%.cpp $(OBJDIR)/%.d
	$(TEST) $(CC) $(COMPILEFLAGS) -Iinclude -o $@ $<

$(OBJDIR)/%.o : src/GuiCode/%.c $(OBJDIR)/%.d
	$(TEST) $(CC) $(COMPILEFLAGS) -Iinclude -o $@ $<

$(OBJDIR)/%.o : src/GuiCode/%.cpp $(OBJDIR)/%.d
	$(TEST) $(CC) $(COMPILEFLAGS) -Iinclude -o $@ $<


To build the library, run
(fix.bat on Windows or ./fix.sh on *NIX) and then
make [DEBUGMODE=1 | PROFILEMODE=1] [STATICLINK=1] [install | clean | installall | cleanall | help] [BUILDDIR=build/directory] [INSTALLDIR=install/directory]

SOLUTION :
These solutions were kindly given by the folks on the help-make mailing list.

All your rules have extra prerequisites on them: $(OBJDIR)/%.d : src/%.c makebuilddirs $(FIXDFILES) ... $(OBJDIR)/%.o : src/%.c $(OBJDIR)/%.d ... makebuilddirs : -$(MKDIR) $(LIBDIR) -$(MKDIR) $(subst /,$(SLASH),$(OBJDIR)) Here we see that all .o's depend on the .d files and all .d files depend on a target "makebuilddirs". That target creates directories, but the target itself (a file named "makebuilddirs") is never created. That means that the target "makebuilddirs" is never up to date, and that means that the .d target is always out of date, and that means that the .o target is always out of date, and that means make will always rebuild it. Every time you run make it "rebuilds" the makebuilddirs target and that causes every other target in your makefile which depends on it (or depends on something that depends on it) to be rebuilt.


Also, a further solution for creating directories was to make them an 'order only prerequisite' by placing them in the prerequisites after a pipe symbol. This way they are only run once before the target's recipe is executed.
BUILDDIR = obj/$(LINKTYPE)/$(BUILDTYPE)

//...

%.d : %.cpp | $(BUILDDIR)
    	$(GCC) -MM -o $@ $<

$(BUILDDIR) :
    	$(MKDIR) $(BUILDDIR)


Best Calculus Textbook?

13 June 2011 - 12:52 AM

I used to know calculus rather well, but I'm afraid the years have taken their toll and rusted out the portion of my brain that knew about it.

So, I'm looking for a good calculus text book that fits these criteria :
1) Is hard bound.
2) Has good reference tables of common derivatives and integrals.
3) Provides good proofs for learning the formulas that govern it.
4) Covers derivatives, integrals, and volume calculations at the least.
5) Advanced calculus like partial differentials not necessary, but might be nice to learn anyway (new to these).

So if you've got a good textbook that you can recommend to me to buy, that would be really great. Please make sure to include the ISBN number of the book so I can get an exact copy.

Thanks,
Edgar

Program continues to run after exit

16 April 2011 - 03:33 PM

First off, I have a library which I built which depends upon Allegro 4.4.1.1. Second, I have a program I wrote which uses my library.

When I link statically to Allegro and to my library, my program stops running after I tell it to quit by using ESC or clicking on the close window button.

When I link dynamically to Allegro and to my library, my program continues to run in the background doing nothing after I tell it to quit.
If I run a debug version that was linked dynamically through the GnuDeBugger, then it exits properly, but does not if I run the debug version outside of gdb.

I used ProcessExplorer to check the status of my program after telling it to exit, and there are two threads left running :

ntdll.dll!RtlUserThreadStart
ntdll.dll!RtlConvertUiListToApiList+0x215

Process Explorer says both threads are in a state of "Wait : User Request".

I know that the atexit routines have been run, because the graphics mode set up by Allegro has been shut down and the onscreen window closes, but the process continues to run as shown by Task Manager and I have to end the process manually.

All libraries and programs were compiled using MinGW 3.4.5 and run on Windows Vista.

Does anyone know what might be causing this behaviour? Or how to solve it? Google has not helped at all.
There is no conditional compilation between dynamic and static versions, so the same code should be running in both instances, so I don't know how to explain it.

PARTNERS