xf.li | bdd93d5 | 2023-05-12 07:10:14 -0700 | [diff] [blame^] | 1 | #*******************************************************************************
|
| 2 | # include build/common makefile
|
| 3 | # ÒÔÉú³ÉÁ½¸öÓ¦ÓÃΪÀý£¬Èç¹ûÖ»ÓÐÒ»¸öɾ³ýEXEC2 OBJS2¼´¿É
|
| 4 | #*******************************************************************************
|
| 5 | include $(COMMON_MK)
|
| 6 |
|
| 7 | EXEC = crc
|
| 8 | OBJS = crc.o
|
| 9 | #EXEC ÌØÓеÄLIB²ÎÊý
|
| 10 | #LDLIBS_demo1 = -lnvram -L$(LIB_DIR)/libnvram
|
| 11 |
|
| 12 | #EXEC2 = demo2
|
| 13 | #OBJS2 = demo2.o
|
| 14 | #EXEC2 ÌØÓеÄLIB²ÎÊý
|
| 15 | #LDLIBS_demo2 = -lsoft_timer -L$(LIB_DIR)/libsoft_timer
|
| 16 |
|
| 17 | #ºêºÍÍ·ÎļþĿ¼ÔÚCFLAGSÀﶨÒ壬ҪÓÃ+=,²»ÒªÓÃ=,·ñÔò»á¸²¸ÇCOMMON_MKÀïµÄÖµ
|
| 18 | #CFLAGS += -I$(APP_DIR)/include
|
| 19 |
|
| 20 | #EXEC EXEC2 ¹«¹²LIB²ÎÊý£¬µÚÒ»Ðж¨ÒåLDLIBSÓÃ=£¬²»ÒªÓÃ+=,Ó¦ÓÃÁ¬½ÓµÄ¿â¶¼ÔÚ±¾Makefile¶¨Òå
|
| 21 | LDLIBS = -lpthread
|
| 22 |
|
| 23 | #*******************************************************************************
|
| 24 | # targets
|
| 25 | #*******************************************************************************
|
| 26 | all: $(EXEC) $(EXEC2)
|
| 27 |
|
| 28 | $(EXEC): $(OBJS)
|
| 29 | $(CC) $(LDFLAGS) -o $@ $^ -Wl,--start-group $(LDLIBS) $(LDLIBS_$@) -Wl,--end-group
|
| 30 | @cp $@ $@.elf
|
| 31 |
|
| 32 | $(EXEC2): $(OBJS2)
|
| 33 | $(CC) $(LDFLAGS) -o $@ $^ -Wl,--start-group $(LDLIBS) $(LDLIBS_$@) -Wl,--end-group
|
| 34 | @cp $@ $@.elf
|
| 35 |
|
| 36 | romfs:
|
| 37 | $(ROMFSINST) $(EXEC) /bin/$(EXEC)
|
| 38 | ######## $(ROMFSINST) $(EXEC2) /bin/$(EXEC2)
|
| 39 |
|
| 40 | clean:
|
| 41 | -@rm -f $(EXEC) $(EXEC2) *.elf *.gdb *.o
|