#initially autogenerated file. #now I'm taking it over manually. # Remove command components RM := rm -rf *.lst *.lis *.lpp *.map libgcc.a *.x *.o *.d # PATHS BELOW ARE SPECIFIC TO MY MACHINE, # UPDATE TO WHERE YOUR TOOLCHAIN IS LOCATED # Also it is assumed that rl78-elf-* tools are in PATH. # Compiler includes OPTLIB_INC := "/usr/rl78-elf/rl78-elf/optlibinc" # Linker includes LIB_INC1 := "/usr/rl78-elf/rl78-elf/lib/g14" LIB_INC2 := "/usr/rl78-elf/lib/gcc/rl78-elf/4.9.2.201604-GNURL78/g14" # All of the sources participating in the build are defined here OBJS += \ ./interrupt_handlers.o \ ./reset_program.o \ ./vector_table.o \ ./main.o \ ./aix.o \ ./lcd.o \ ./gui.o \ ./wave.o \ ./ctrl.o \ ./fs.o \ ./debug.o # Add inputs and outputs from these tool invocations to the build variables LINKER_OUTPUT_OUTPUTS += \ klavirko-ui.x \ # All Target # Main-build Target all: klavirko-ui.mot klavirko-ui.hex @echo 'Build complete.' # Tool invocations klavirko-ui.mot: $(LINKER_OUTPUT_OUTPUTS) rl78-elf-objcopy -O srec $(LINKER_OUTPUT_OUTPUTS)"klavirko-ui.mot" klavirko-ui.hex: $(LINKER_OUTPUT_OUTPUTS) rl78-elf-objcopy -O ihex $(LINKER_OUTPUT_OUTPUTS)"klavirko-ui.hex" klavirko-ui.x: $(OBJS) $(LIBRARY_GENERATOR_OUTPUTTYPE_OUTPUTS) $(ALL_ASMS) memory.ld LinkerSubCommand.tmp rl78-elf-ld -o "klavirko-ui.x" -T"memory.ld" @"LinkerSubCommand.tmp" $(USER_OBJS) $(LIBS) $(LIBRARY_GENERATOR_OUTPUTTYPE_OUTPUTS) -M=klavirko-ui.map -L$(LIB_INC1) -L$(LIB_INC2) --start-group -loptm -loptc -lgcc --end-group -e_PowerON_Reset memory.ld: ./metalinker.pl ./memory_template.ld size.tmp LinkerSubCommand.tmp ./metalinker.pl LinkerSubCommand.tmp size.tmp memory.ld size.tmp: $(OBJS) rl78-elf-size *.o -A > size.tmp # Build the objects # TODO: consider defining all repeating parameters as variable to avoid repetition. # hardware_setup.o: ./hardware_setup.c # rl78-elf-gcc -MM -MP -MF "hardware_setup.d" -MT"hardware_setup.o" -MT"hardware_setup.d" -x c -nostdinc -I$(OPTLIB_INC) -mg14 "$<" # rl78-elf-gcc -c -x c -Wa,-adlhn="$(basename $(notdir $<)).lst" -nostdinc -I"$(OPTLIB_INC)" -mg14 -o "$(@:%.d=%.o)" "$<" interrupt_handlers.o: ./interrupt_handlers.c ./interrupt_handlers.h ./aix.h ./fs.h ./gui.h ./main.h ./ctrl.h rl78-elf-gcc -MM -MP -MF "interrupt_handlers.d" -MT"interrupt_handlers.o" -MT"interrupt_handlers.d" -x c -nostdinc -I$(OPTLIB_INC) -Wstack-usage=312 -mg14 "$<" rl78-elf-gcc -c -x c -Wa,-adlhn="$(basename $(notdir $<)).lst" -nostdinc -I$(OPTLIB_INC) -Wstack-usage=312 -mg14 -o "$(@:%.d=%.o)" "$<" reset_program.o: ./reset_program.asm rl78-elf-gcc -MM -MP -MF "reset_program.d" -MT"reset_program.o" -MT"reset_program.d" -x assembler-with-cpp -nostdinc -I$(OPTLIB_INC) -Wstack-usage=312 -mg14 "$<" rl78-elf-gcc -c -x assembler-with-cpp -Wa,-adlhn="$(basename $(notdir $<)).lst" -nostdinc -I$(OPTLIB_INC) -Wstack-usage=312 -mg14 -o "$(@:%.d=%.o)" "$<" main.o: ./main.c ./main.h ./aix.h ./lcd.h ./gui.h ./ctrl.h ./fs.h rl78-elf-gcc -MM -MP -MF "main.d" -MT"main.o" -MT"main.d" -x c -nostdinc -I$(OPTLIB_INC) -Wstack-usage=312 -mg14 "$<" rl78-elf-gcc -c -x c -Wa,-adlhn="$(basename $(notdir $<)).lst" -nostdinc -I$(OPTLIB_INC) -Wstack-usage=312 -mg14 -o "$(@:%.d=%.o)" "$<" aix.o: ./aix.c ./aix.h ./debug.h ./wave.h ./gui.h rl78-elf-gcc -MM -MP -MF "aix.d" -MT"aix.o" -MT"aix.d" -x c -nostdinc -I$(OPTLIB_INC) -Wstack-usage=312 -mg14 "$<" rl78-elf-gcc -c -x c -Wa,-adlhn="$(basename $(notdir $<)).lst" -nostdinc -I$(OPTLIB_INC) -Wstack-usage=312 -mg14 -o "$(@:%.d=%.o)" "$<" lcd.o: ./lcd.c ./lcd.h ./main.h ./debug.h font.h rl78-elf-gcc -MM -MP -MF "lcd.d" -MT"lcd.o" -MT"lcd.d" -x c -nostdinc -I$(OPTLIB_INC) -Wstack-usage=312 -mg14 "$<" rl78-elf-gcc -c -x c -Wa,-adlhn="$(basename $(notdir $<)).lst" -nostdinc -I$(OPTLIB_INC) -Wstack-usage=312 -mg14 -o "$(@:%.d=%.o)" "$<" gui.o: ./gui.c ./gui.h ./debug.h ./wave.h ./lcd.h ./main.h ./fs.h ./ctrl.h rl78-elf-gcc -MM -MP -MF "gui.d" -MT"gui.o" -MT"gui.d" -x c -nostdinc -I$(OPTLIB_INC) -Wstack-usage=312 -mg14 "$<" rl78-elf-gcc -c -x c -Wa,-adlhn="$(basename $(notdir $<)).lst" -nostdinc -I$(OPTLIB_INC) -Wstack-usage=312 -mg14 -o "$(@:%.d=%.o)" "$<" debug.o: ./debug.c ./debug.h ./main.h rl78-elf-gcc -MM -MP -MF "debug.d" -MT"debug.o" -MT"debug.d" -x c -nostdinc -I$(OPTLIB_INC) -Wstack-usage=312 -mg14 "$<" rl78-elf-gcc -c -x c -Wa,-adlhn="$(basename $(notdir $<)).lst" -nostdinc -I$(OPTLIB_INC) -Wstack-usage=312 -mg14 -o "$(@:%.d=%.o)" "$<" wave.o: ./wave.c ./wave.h ./aix.h ./debug.h ./ctrl.h sinus.h rl78-elf-gcc -MM -MP -MF "wave.d" -MT"wave.o" -MT"wave.d" -x c -nostdinc -I$(OPTLIB_INC) -Wstack-usage=312 -mg14 "$<" rl78-elf-gcc -c -x c -Wa,-adlhn="$(basename $(notdir $<)).lst" -nostdinc -I$(OPTLIB_INC) -Wstack-usage=312 -mg14 -o "$(@:%.d=%.o)" "$<" ctrl.o: ./ctrl.c ./ctrl.h ./wave.h ./debug.h ./gui.h rl78-elf-gcc -MM -MP -MF "ctrl.d" -MT"ctrl.o" -MT"ctrl.d" -x c -nostdinc -I$(OPTLIB_INC) -Wstack-usage=312 -mg14 "$<" rl78-elf-gcc -c -x c -Wa,-adlhn="$(basename $(notdir $<)).lst" -nostdinc -I$(OPTLIB_INC) -Wstack-usage=312 -mg14 -o "$(@:%.d=%.o)" "$<" fs.o: ./fs.c ./fs.h ./debug.h ./main.h ./gui.h ./wave.h rl78-elf-gcc -MM -MP -MF "fs.d" -MT"fs.o" -MT"fs.d" -x c -nostdinc -I$(OPTLIB_INC) -Wstack-usage=312 -mg14 "$<" rl78-elf-gcc -c -x c -Wa,-adlhn="$(basename $(notdir $<)).lst" -nostdinc -I$(OPTLIB_INC) -Wstack-usage=312 -mg14 -o "$(@:%.d=%.o)" "$<" vector_table.o: ./vector_table.c ./interrupt_handlers.h ./aix.h ./ctrl.h ./gui.h ./lcd.h rl78-elf-gcc -MM -MP -MF "vector_table.d" -MT"vector_table.o" -MT"vector_table.d" -x c -nostdinc -I$(OPTLIB_INC) -Wstack-usage=312 -mg14 "$<" rl78-elf-gcc -c -x c -Wa,-adlhn="$(basename $(notdir $<)).lst" -nostdinc -I$(OPTLIB_INC) -Wstack-usage=312 -mg14 -o "$(@:%.d=%.o)" "$<" sinus.h: sinus ./sinus > sinus.h sinus: ./sinus.c gcc -lm -Wall -o sinus sinus.c font.h: img2fnt ./font16.png ./font8.png ./img2fnt FONT8 ./font8.png > font.h ./img2fnt FONT16 ./font16.png >> font.h img2fnt: ./img2fnt.c gcc -lIL -Wall -o img2fnt img2fnt.c # Other Targets clean: rm -rf klavirko-ui.mot klavirko-ui.hex font.h sinus.h img2fnt sinus memory.ld $(RM) # What is phony? Please explain. .PHONY: all clean dependents .SECONDARY: