First commit to this server
This commit is contained in:
1 parent
ec05d3601a
commit
cce6f6b9c6
44 files changed
+5529
-296
No files matched your search
@@ -0,0 +1,61 @@
|
||||
# This is a recursive makefile- do not use in production
|
||||
# convert to canonical make chain when time permits
|
||||
#
|
||||
# recursive file search
|
||||
rfilelist=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rfilelist,$d/,$2))
|
||||
# the name of program
|
||||
TARGET = interp
|
||||
CC = gcc
|
||||
# C++ compiler flags
|
||||
|
||||
LIBS += -pthread -lconfig
|
||||
EXT = c
|
||||
# source files
|
||||
SRC = ./src
|
||||
SRCS := $(call rfilelist,$(SRC),*.$(EXT))
|
||||
INCLUDES = ./include ./include/utils
|
||||
CFLAGS := -Wall -std=c11 -c
|
||||
CFLAGS += $(addprefix -I,$(INCLUDES))
|
||||
OBJS = $(SRCS:%.$(EXT)=%.o)
|
||||
DEBUG_HELPERS = $(SRCS:%.$(EXT)=%.debug)
|
||||
OPTIMIZE_HELPERS = $(SRCS:%.$(EXT)=%.optim)
|
||||
OBJDEBOUT = $(@:%.debug=%.o)
|
||||
OBJOPTOUT = $(@:%.optim=%.o)
|
||||
DEBOUT = $(@:%.debug=%.$(EXT))
|
||||
OPTOUT = $(@:%.optim=%.$(EXT))
|
||||
|
||||
# rules for debug build and optimized build
|
||||
%.debug: %.$(EXT)
|
||||
$(CC) $(CFLAGS) -ggdb -D_DEBUG -DDEBUG -o $(OBJDEBOUT) $(DEBOUT)
|
||||
rm -f $(@.debug=%.debug)
|
||||
touch -f $@
|
||||
|
||||
%.optim: %.$(EXT)
|
||||
$(CC) $(CFLAGS) -O2 -DNDEBUG -o $(OBJOPTOUT) $(OPTOUT)
|
||||
rm -f $(@.optim=%.optim)
|
||||
touch -f $@
|
||||
|
||||
# rules for object files
|
||||
%.o: %.$(EXT)
|
||||
$(CC) $(CFLAGS) $?
|
||||
|
||||
# default build
|
||||
all: debug
|
||||
|
||||
# debug build
|
||||
debug: $(DEBUG_HELPERS)
|
||||
test -s $@ || mkdir $@
|
||||
$(CC) $(OBJS) -o debug/$(TARGET) $(LIBS)
|
||||
rm -f $(DEBUG_HELPERS)
|
||||
|
||||
# optimized build
|
||||
optim: $(OPTIMIZE_HELPERS)
|
||||
test -s $@ || mkdir $@
|
||||
$(CC) $(OBJS) -o optim/$(TARGET) $(LIBS)
|
||||
rm -f $(OPTIMIZE_HELPERS)
|
||||
strip optim/$(TARGET)
|
||||
|
||||
# clean rule
|
||||
clean:
|
||||
rm -f $(OBJS) $(DEBUG_HELPERS) $(OPTIMIZE_HELPERS)
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Generic makefile, use this for hacking or building on other architectures. This will build on the Raspberry Pi as is.
|
||||
@@ -0,0 +1,39 @@
|
||||
TEMPLATE = app
|
||||
CONFIG += console
|
||||
CONFIG -= app_bundle
|
||||
CONFIG -= qt
|
||||
TARGET = interp
|
||||
|
||||
QMAKE_CFLAGS += -Wall -std=c17 -Wno-unused-parameter
|
||||
QMAKE_CFLAGS += -Wno-unused-function -Wno-unused-result
|
||||
QMAKE_CFLAGS += -Wno-discarded-qualifiers -Wno-int-conversion
|
||||
QMAKE_CFLAGS += -Wno-incompatible-pointer-types
|
||||
|
||||
INCLUDEPATH += $$PWD/../include
|
||||
|
||||
LIBS += -lpthread
|
||||
|
||||
SOURCES += \
|
||||
../src/foo1.c \
|
||||
../src/intrinsic.c \
|
||||
../src/support.c \
|
||||
../src/main.c \
|
||||
../src/support.c \
|
||||
../src/utils/filesys.c \
|
||||
../src/utils/huff.c \
|
||||
../src/utils/config.c
|
||||
|
||||
HEADERS += \
|
||||
../include/commands.h \
|
||||
../include/foo1.h \
|
||||
../include/intrinsic.h \
|
||||
../include/parser.h \
|
||||
../include/simple_strlib.h \
|
||||
../include/support.h \
|
||||
../include/utils/filesys.h \
|
||||
../include/utils/huff.h \
|
||||
../include/utils/config.h
|
||||
|
||||
CONFIG(release, debug|release) {
|
||||
QMAKE_POST_LINK=$(STRIP) $(TARGET)
|
||||
}
|
||||
Reference in new issue
Block a user