分类: LINUX
2007-12-03 17:37:22
#Makefile by Zeroman CROSS = arm-uclibc- #CROSS=/opt/host/armv4l/bin/armv4l-unknown-linux- #########################param for make########################## BU = MUL = test.elf ################################################################# ifeq ($(BU),arm) CC = arm-uclibc-gcc HEADFILE = INC = /minigui/arm-1224/include LIB = /minigui/arm-1224/lib CFLAGS = -Wall -rdynamic -s -I$(INC) -L$(LIB) -lpthread -lminigui -lmgext -ldl #DSTDIR = /tftpboot/root/home/ DSTDIR = ./ else BU = Linux-i386 CC = gcc-3.4 HEADFILE = INC = /minigui/newlib/include LIB = /minigui/newlib/lib CFLAGS = -Wall -rdynamic -s -I$(INC) -L$(LIB) -lpthread -lminigui -lmgext -ldl DSTDIR = ./ endif SRC = $(wildcard *.c) ELF = $(addsuffix .elf, $(basename $(SRC))) all:$(ELF) mul:$(SRC) $(CC) $(CFLAGS) -o $(MUL) $(SRC) indent:$(ELF) indent -bad -bap -bbb -bbo -nbc -bl -bli0 -bls -c33 -cd33 -ncdb -ncdw -nce -cli0 -cp33 -cs -d0 -nbfda -di2 -nfc1 -nfca -hnl -ip5 -l75 -lp -pcs -nprs -npsl -saf -sai -saw -nsc -sob -nss -i4 -ts4 -ut $^ tags:$(ELF) /blt/cmd/set-tags.sh `pwd` %.elf : %.c @$(CC) $(CFLAGS) -o $(ELFDIR)$@ $< @echo -e " [$(BU)] \tComplile $< to $@" PHONY: clean clean: @rm $(ELF) @echo "Cleaning old ELF files..." #rm /var/tmp/mginit |