Sfoglia il codice sorgente

Merge pull request #19 from mtardy/portable-makefile

Use implicit rules to build binary; add compiler/linker search locati…
master
mtardy 4 anni fa
committed by GitHub
parent
commit
084c45add3
Non sono state trovate chiavi note per questa firma nel database ID Chiave GPG: 4AEE18F83AFDEB23
1 ha cambiato i file con 12 aggiunte e 7 eliminazioni
  1. +12
    -7
      Makefile

+ 12
- 7
Makefile Vedi File

@ -1,15 +1,20 @@
LEG = leg
CC = cc
CFLAGS = -Wall -g
LDLIBS = -L/usr/local/lib -lgc
CFLAGS = -I/usr/local/include -I/opt/local/include -Wall -Wno-unused-label -g
LDLIBS = -L/usr/local/lib -L/opt/local/lib -lgc
all : parse
# moved LDLIBS to end because ld scans files from left to right and collects only required symbols
parse: parse.c object.c
$(CC) $(CFLAGS) -o parse parse.c $(LDLIBS)
%: %.c object.c
$(CC) $(CFLAGS) -o $@ $< $(LDLIBS)
parse.c: parse.leg
$(LEG) -o parse.c parse.leg
%.c: %.leg
$(LEG) -o $@ $<
clean:
rm parse parse.c
rm -f parse parse.c
opt:
$(MAKE) CFLAGS="-DNDEBUG -O3 -fomit-frame-pointer"

Caricamento…
Annulla
Salva