Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HEX = main.hex
- TAR=debug
- DEV=/home/sarma/intrests/arm/arm\ test\ suite/dev
- INCL=$(DEV)/inc
- # preprocessor headers
- SRC=$(DEV)/src
- # source file directory
- LNK= $(OBJPATH)/tnkernel_startup_gcc.o\
- $(OBJPATH)/startup_hardware_init.o
- # Startup modules to belinked
- LS = $(DEV)/startup/lpc2148_gcc.ld
- # linker script
- OBJPATH=$(DEV)/obj
- #debug.c is in PWD the rest are in $(SRC)/$(shell basename <object_module> .o)/ location.
- OBJ = debug.o\
- sw_delay.o\
- led.o\
- lcd.o\
- buzzer.o
- GCCFLAGS = -I $(INCL)
- %.o:$(SRC)/$(shell basename .o)/$(shell basename %.c)
- arm-elf-gcc -mcpu=arm7tdmi -mlittle-endian -Wall -O0 -gdwarf-2 -std=c99 -march=armv4t -mlittle-endian -fno-builtin $(GCCFLAGS) -c $<
- $(HEX):$(HEX:.hex=.c) $(OBJ)
- arm-elf-gcc -mcpu=arm7tdmi -mlittle-endian -Wall -O0 -gdwarf-2 -std=c99 -march=armv4t -mlittle-endian -fno-builtin -nostartfiles -Wl,-Map=$(HEX:.hex=.map),--cref -lc -lm -lc -lgcc -T $(LS) $(HEX:.hex=.c) $(OBJ) -o $(HEX:.hex=.o) $(GCCFLAGS) $(LNK)
- arm-elf-objcopy -I ihex $(HEX:.hex=.o) $(HEX)
- hex:
- mv $(TAR).o $(OBJPATH)
- cp $(HEX) /tmp/
- clean: hex
- rm -f $(HEX:.hex=.o)
- rm -f *.map
- rm -f *~
- distclean:clean
- rm -f *.hex
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement