Makefile and compiling help April 10, 2009 08:41AM | Registered: 15 years ago Posts: 4 |
OBJS = $(NAME).$(O) \ foe.$(O) foecommand.$(O) barragemanager.$(O) boss.$(O) ship.$(O) laser.$(O) \ frag.$(O) background.$(O) letterrender.$(O) shot.$(O) \ screen.$(O) vector.$(O) degutil.$(O) rand.$(O) mt19937int.$(O) \ soundmanager.$(O) attractmanager.$(O) \ $(NAME)_res.$(O)
Re: Makefile and compiling help April 10, 2009 04:58PM | Registered: 15 years ago Posts: 83 |
OBJS = $(NAME).$(O) \ foe.$(O) foecommand.$(O) barragemanager.$(O) boss.$(O) ship.$(O) laser.$(O) \ frag.$(O) background.$(O) letterrender.$(O) shot.$(O) \ screen.$(O) vector.$(O) degutil.$(O) rand.$(O) mt19937int.$(O) \ soundmanager.$(O) attractmanager.$(O) \ $(NAME)_res.$(O)Don't think I've ever seen it done like that. I'm assuming the above files are all of your source code? Would you mind posting the entire makefile so we can see where the above block is located? Have you tried commenting the above block of code out, then recompiling to see if it gives same errors in linking?
Re: Makefile and compiling help April 10, 2009 06:12PM | Registered: 15 years ago Posts: 4 |
Re: Makefile and compiling help April 10, 2009 06:37PM | Registered: 15 years ago Posts: 83 |
Re: Makefile and compiling help April 11, 2009 05:44AM | Registered: 15 years ago Posts: 4 |
#--------------------------------------------------------------------------------- # Clear the implicit built in rules #--------------------------------------------------------------------------------- .SUFFIXES: #--------------------------------------------------------------------------------- ifeq ($(strip $(DEVKITPPC)),) $(error "Please set DEVKITPPC in your environment. export DEVKITPPC=devkitPPC") endif include $(DEVKITPPC)/wii_rules #--------------------------------------------------------------------------------- # TARGET is the name of the output # BUILD is the directory where object files & intermediate files will be placed # SOURCES is a list of directories containing source code # INCLUDES is a list of directories containing extra header files #--------------------------------------------------------------------------------- TARGET := $(notdir $(CURDIR)) BUILD := build SOURCES := source DATA := data INCLUDES := #--------------------------------------------------------------------------------- # options for code generation #--------------------------------------------------------------------------------- CFLAGS = -g -O2 -Wall $(MACHDEP) $(INCLUDE) CXXFLAGS = $(CFLAGS) LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map #--------------------------------------------------------------------------------- # any extra libraries we wish to link with the project #--------------------------------------------------------------------------------- LIBS := -lgl2gx -lfreetype -ljpeg -lpng -lz -lSDL -lfat -lwiiuse -lbte -logc -lm #--------------------------------------------------------------------------------- # list of directories containing libraries, this must be the top level containing # include and lib #--------------------------------------------------------------------------------- LIBDIRS := #--------------------------------------------------------------------------------- # no real need to edit anything past this point unless you need to add additional # rules for different file extensions #--------------------------------------------------------------------------------- ifneq ($(BUILD),$(notdir $(CURDIR))) #--------------------------------------------------------------------------------- export OUTPUT := $(CURDIR)/$(TARGET) export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \ $(foreach dir,$(DATA),$(CURDIR)/$(dir)) export DEPSDIR := $(CURDIR)/$(BUILD) #--------------------------------------------------------------------------------- # automatically build a list of object files for our project #--------------------------------------------------------------------------------- CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c))) CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp))) sFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s))) SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S))) BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) #--------------------------------------------------------------------------------- # use CXX for linking C++ projects, CC for standard C #--------------------------------------------------------------------------------- ifeq ($(strip $(CPPFILES)),) export LD := $(CC) else export LD := $(CXX) endif export OFILES := $(addsuffix .o,$(BINFILES)) \ $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \ $(sFILES:.s=.o) $(SFILES:.S=.o) #--------------------------------------------------------------------------------- # build a list of include paths #--------------------------------------------------------------------------------- export INCLUDE := $(foreach dir,$(INCLUDES), -iquote $(CURDIR)/$(dir)) \ $(foreach dir,$(LIBDIRS),-I$(dir)/include) \ -I$(CURDIR)/$(BUILD) \ -I$(LIBOGC_INC) #--------------------------------------------------------------------------------- # build a list of library paths #--------------------------------------------------------------------------------- export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \ -L$(LIBOGC_LIB) export OUTPUT := $(CURDIR)/$(TARGET) .PHONY: $(BUILD) clean #--------------------------------------------------------------------------------- $(BUILD): @[ -d $@ ] || mkdir -p $@ @make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile #--------------------------------------------------------------------------------- clean: @echo clean ... @rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol #--------------------------------------------------------------------------------- run: wiiload $(TARGET).dol #--------------------------------------------------------------------------------- else DEPENDS := $(OFILES:.o=.d) #--------------------------------------------------------------------------------- # main targets #--------------------------------------------------------------------------------- $(OUTPUT).dol: $(OUTPUT).elf $(OUTPUT).elf: $(OFILES) #--------------------------------------------------------------------------------- # This rule links in binary data with the .jpg extension #--------------------------------------------------------------------------------- %.jpg.o : %.jpg #--------------------------------------------------------------------------------- @echo $(notdir $<) $(bin2o) -include $(DEPENDS) #--------------------------------------------------------------------------------- endif #---------------------------------------------------------------------------------
Re: Makefile and compiling help April 11, 2009 05:57AM | Registered: 15 years ago Posts: 83 |
Re: Makefile and compiling help April 11, 2009 07:33AM | Registered: 15 years ago Posts: 4 |
rr.o: In function `parseArgs': C:/devkitpro/projects/rr/source/rr.c:221: undefined reference to `nowait' screen.o: In function `drawCircle': C:/devkitpro/projects/rr/source/screen.c:481: undefined reference to `glColor4ub' C:/devkitpro/projects/rr/source/screen.c:490: undefined reference to `glColor4ub' C:/devkitpro/projects/rr/source/screen.c:483: undefined reference to `glColor4ub' screen.o: In function `drawLaser': C:/devkitpro/projects/rr/source/screen.c:321: undefined reference to `glColor4ub' C:/devkitpro/projects/rr/source/screen.c:324: undefined reference to `glColor4ub' screen.o:C:/devkitpro/projects/rr/source/screen.c:326: more undefined references to `glColor4ub' follow screen.o: In function `drawBoard': C:/devkitpro/projects/rr/source/screen.c:788: undefined reference to `glVertex2f' C:/devkitpro/projects/rr/source/screen.c:789: undefined reference to `glVertex2f' C:/devkitpro/projects/rr/source/screen.c:790: undefined reference to `glVertex2f' C:/devkitpro/projects/rr/source/screen.c:791: undefined reference to `glVertex2f' screen.o: In function `screenResized': C:/devkitpro/projects/rr/source/screen.c:39: undefined reference to `glViewport' C:/devkitpro/projects/rr/source/screen.c:40: undefined reference to `glMatrixMode' C:/devkitpro/projects/rr/source/screen.c:43: undefined reference to `glMatrixMode' screen.o: In function `startDrawBoards': C:/devkitpro/projects/rr/source/screen.c:771: undefined reference to `glMatrixMode' C:/devkitpro/projects/rr/source/screen.c:774: undefined reference to `glOrtho' C:/devkitpro/projects/rr/source/screen.c:775: undefined reference to `glMatrixMode' screen.o: In function `drawBox': C:/devkitpro/projects/rr/source/screen.c:210: undefined reference to `glColor4ub' C:/devkitpro/projects/rr/source/screen.c:217: undefined reference to `glColor4ub' screen.o: In function `drawShot': C:/devkitpro/projects/rr/source/screen.c:749: undefined reference to `glColor4ub' C:/devkitpro/projects/rr/source/screen.c:759: undefined reference to `glColor4ub' C:/devkitpro/projects/rr/source/screen.c:763: undefined reference to `glColor4ub' screen.o:C:/devkitpro/projects/rr/source/screen.c:429: more undefined references to `glColor4ub' follow screen.o: In function `loadGLTexture': C:/devkitpro/projects/rr/source/screen.c:87: undefined reference to `glTexParameteri' C:/devkitpro/projects/rr/source/screen.c:88: undefined reference to `glTexParameteri' C:/devkitpro/projects/rr/source/screen.c:89: undefined reference to `gluBuild2DMipmaps' screen.o: In function `initGL': C:/devkitpro/projects/rr/source/screen.c:53: undefined reference to `glViewport' C:/devkitpro/projects/rr/source/screen.c:56: undefined reference to `glLineWidth' C:/devkitpro/projects/rr/source/screen.c:59: undefined reference to `glBlendFunc'