Makefile.ds
changeset 5515 0fcf231a6e74
parent 5428 cff5d3cd5777
child 5536 05af1b9ff46d
equal deleted inserted replaced
5514:6bd701987ba9 5515:0fcf231a6e74
    15 # DATA is a list of directories containing data files
    15 # DATA is a list of directories containing data files
    16 # INCLUDES is a list of directories containing header files
    16 # INCLUDES is a list of directories containing header files
    17 #---------------------------------------------------------------------------------
    17 #---------------------------------------------------------------------------------
    18 TARGET		:=	$(shell basename $(CURDIR))
    18 TARGET		:=	$(shell basename $(CURDIR))
    19 BUILD		:=	src
    19 BUILD		:=	src
    20 SOURCES		:=	source
    20 SOURCES		:=	src
    21 DATA		:=	data
    21 DATA		:=	data
    22 INCLUDES	:=	include
    22 INCLUDES	:=	include
    23 
    23 
    24 #---------------------------------------------------------------------------------
    24 #---------------------------------------------------------------------------------
    25 # options for code generation
    25 # options for code generation
    51 
    51 
    52 #---------------------------------------------------------------------------------
    52 #---------------------------------------------------------------------------------
    53 # list of directories containing libraries, this must be the top level containing
    53 # list of directories containing libraries, this must be the top level containing
    54 # include and lib
    54 # include and lib
    55 #---------------------------------------------------------------------------------
    55 #---------------------------------------------------------------------------------
    56 LIBDIRS	:=	$(LIBNDS)
    56 LIBDIRS	:=	$(LIBNDS) $(PORTLIBS)
    57 
    57 
    58 #---------------------------------------------------------------------------------
    58 #---------------------------------------------------------------------------------
    59 # no real need to edit anything past this point unless you need to add additional
    59 # no real need to edit anything past this point unless you need to add additional
    60 # rules for different file extensions
    60 # rules for different file extensions
    61 #---------------------------------------------------------------------------------
    61 #---------------------------------------------------------------------------------
   169 export OFILES	:=	$(addsuffix .o,$(BINFILES)) \
   169 export OFILES	:=	$(addsuffix .o,$(BINFILES)) \
   170 			$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
   170 			$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
   171 
   171 
   172 export INCLUDE	:=	$(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
   172 export INCLUDE	:=	$(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
   173 			$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
   173 			$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
   174 			-I$(CURDIR)/$(BUILD)
   174 			-I$(CURDIR)/$(BUILD) \
       
   175 			-I$(PORTLIBS)/include/SDL
   175 
   176 
   176 .PHONY: $(BUILD) clean all
   177 .PHONY: $(BUILD) clean all
   177 
   178 
   178 #---------------------------------------------------------------------------------
   179 #---------------------------------------------------------------------------------
   179 all: arm_only $(BUILD) install nds_test
   180 all: arm_only $(BUILD) install nds_test
   184 $(BUILD): lib
   185 $(BUILD): lib
   185 	@[ -d $@ ] || mkdir -p $@
   186 	@[ -d $@ ] || mkdir -p $@
   186 	@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.ds -s
   187 	@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile.ds -s
   187 
   188 
   188 install: $(BUILD)
   189 install: $(BUILD)
   189 	@cp $(OUTPUT) $(DEVKITPRO)/libnds/lib/
   190 	@mkdir -p $(PORTLIBS)/include/SDL/
   190 	@mkdir -p $(DEVKITPRO)/libnds/include/SDL/
   191 	@rsync -a $(OUTPUT) $(PORTLIBS)/lib/
   191 	@cp include/*.h $(DEVKITPRO)/libnds/include/SDL/
   192 	@rsync -a include/*.h $(PORTLIBS)/include/SDL/
   192 
   193 
   193 nds_test:
   194 nds_test:
   194 	$(MAKE) -C test/nds-test-progs
   195 	$(MAKE) -C test/nds-test-progs -s
   195 
   196 
   196 tags:
   197 tags:
   197 	etags $(SRCS)
   198 	cd $(SOURCES); etags $(CFILES)
   198 
   199 
   199 # This file must be compiled with the ARM instruction set, not
   200 # This file must be compiled with the ARM instruction set, not
   200 # thumb. Use devkitpro way of doing things.
   201 # thumb. Use devkitpro way of doing things.
   201 arm_only: src/atomic/SDL_spinlock.arm.c
   202 arm_only: src/atomic/SDL_spinlock.arm.c
   202 src/atomic/SDL_spinlock.arm.c: src/atomic/SDL_spinlock.c
   203 src/atomic/SDL_spinlock.arm.c: src/atomic/SDL_spinlock.c
   204 
   205 
   205 #---------------------------------------------------------------------------------
   206 #---------------------------------------------------------------------------------
   206 clean:
   207 clean:
   207 	@echo clean ...
   208 	@echo clean ...
   208 	@cd src; rm -fr $(OFILES) $(OFILES:.o=.d) lib
   209 	@cd src; rm -fr $(OFILES) $(OFILES:.o=.d) lib
       
   210 	@rm -f $(OUTPUT)
       
   211 	@make -C test/nds-test-progs -s clean
   209 
   212 
   210 #---------------------------------------------------------------------------------
   213 #---------------------------------------------------------------------------------
   211 else
   214 else
   212 
   215 
   213 DEPENDS	:=	$(OFILES:.o=.d)
   216 DEPENDS	:=	$(OFILES:.o=.d)