Created
May 30, 2016 15:46
-
-
Save libcrack/df95b2b9a211b61040697d2139f6bd35 to your computer and use it in GitHub Desktop.
GNU/Linux Makefile base template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CC := gcc | |
| BIN := pcap | |
| LDLIBS := -lpcap | |
| LDFLAGS := | |
| CFLAGS := -Wall -Wno-parentheses -fomit-frame-pointer | |
| CPPFLAGS := | |
| DEBUG := $(CFLAGS) -O0 -ggdb -fvar-tracking-assignments -fvar-tracking -fno-builtin | |
| all: $(BIN) | |
| debug: | |
| CFLAGS="$(DEBUG)" make | |
| %.o: %.c | |
| $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@ $< | |
| %: %.o | |
| $(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LOADLIBES) $(LDLIBS) -o $@ | |
| clean: | |
| rm -f *~ *.o $(BIN) | |
| help: | |
| echo "make all|debug|clean|help" | |
| .PHONY: all clean debug help | |
| .SILENT: all clean debug help |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment